integration of the system keymap, loaded when settings one loading fails

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8752 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2004-08-31 22:06:54 +00:00
parent 5b7cb6de0a
commit dbf6aa568b
3 changed files with 26 additions and 6 deletions
+21 -2
View File
@@ -164,10 +164,13 @@ InputServer::InitKeyboardMouseStates(void)
sMousePos.x = 200;
sMousePos.y = 200;
LoadKeymap();
if (LoadKeymap()!=B_OK)
LoadSystemKeymap();
}
#include "SystemKeymap.cpp"
status_t
InputServer::LoadKeymap()
{
@@ -208,6 +211,21 @@ InputServer::LoadKeymap()
return B_OK;
}
status_t
InputServer::LoadSystemKeymap()
{
if (!fChars)
delete[] fChars;
fKeys = sSystemKeymap;
fCharsSize = sSystemKeyCharsSize;
fChars = new char[fCharsSize];
memcpy(fChars, sSystemKeyChars, fCharsSize);
// TODO : save this keymap to file
}
/*
* Method: InputServer::QuitRequested()
* Descr:
@@ -654,7 +672,8 @@ InputServer::HandleGetSetKeyMap(BMessage *message,
if (status == B_OK)
status = reply->AddData("key_buffer", B_ANY_TYPE, fChars, fCharsSize);
} else {
LoadKeymap();
if (LoadKeymap()!=B_OK)
LoadSystemKeymap();
status = ControlDevices(NULL, B_KEYBOARD_DEVICE, B_KEY_MAP_CHANGED, NULL);
}
+1
View File
@@ -183,6 +183,7 @@ public:
private:
status_t LoadKeymap();
status_t LoadSystemKeymap();
bool sEventLoopRunning;
bool sSafeMode;
+4 -4
View File
@@ -1,5 +1,9 @@
SubDir OBOS_TOP src servers input ;
if $(COMPILE_FOR_R5) {
SubDirC++Flags -DCOMPILE_FOR_R5 ;
}
rule MkKeymapHeader
{
local binary = $(1) ;
@@ -25,10 +29,6 @@ MkKeymapHeader [ FGristFiles SystemKeymap.cpp ] : US-International.keymap ;
SEARCH on US-International.keymap
+= [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) apps bin keymap ] ;
if $(COMPILE_FOR_R5) {
SubDirC++Flags -DCOMPILE_FOR_R5 ;
}
AddResources input_server : input_server.rdef ;
UsePrivateHeaders app ;