the keymap is now saved when key locks or key modifiers are changed

this fixes bug #1282


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21625 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2007-07-16 18:40:32 +00:00
parent 1fa400cd92
commit d57634f732
3 changed files with 17 additions and 0 deletions
+1
View File
@@ -40,6 +40,7 @@
#define SYSTEM_SHUTTING_DOWN 'SSDn'
#define IS_SAVE_SETTINGS 'Isst'
#define IS_SAVE_KEYMAP 'Iskp'
// app_server communication
#define IS_ACQUIRE_INPUT 'Iaqi'
+15
View File
@@ -322,6 +322,13 @@ InputServer::_LoadSystemKeymap()
memcpy(fChars, kSystemKeyChars, fCharsSize);
// TODO: why are we doing this?
return _SaveKeymap();
}
status_t
InputServer::_SaveKeymap()
{
// we save this keymap to file
BPath path;
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) != B_OK)
@@ -585,6 +592,10 @@ InputServer::MessageReceived(BMessage* message)
fMouseSettings.SaveSettings();
return;
case IS_SAVE_KEYMAP:
_SaveKeymap();
return;
case B_SOME_APP_LAUNCHED:
{
const char *signature;
@@ -738,6 +749,8 @@ InputServer::HandleSetModifierKey(BMessage* message, BMessage* reply)
// TODO: unmap the key ?
be_app_messenger.SendMessage(IS_SAVE_KEYMAP);
BMessage msg(IS_CONTROL_DEVICES);
msg.AddInt32("type", B_KEYBOARD_DEVICE);
msg.AddInt32("code", B_KEY_MAP_CHANGED);
@@ -752,6 +765,8 @@ status_t
InputServer::HandleSetKeyboardLocks(BMessage* message, BMessage* reply)
{
if (message->FindInt32("locks", (int32*)&fKeys.lock_settings) == B_OK) {
be_app_messenger.SendMessage(IS_SAVE_KEYMAP);
BMessage msg(IS_CONTROL_DEVICES);
msg.AddInt32("type", B_KEYBOARD_DEVICE);
msg.AddInt32("code", B_KEY_LOCKS_CHANGED);
+1
View File
@@ -171,6 +171,7 @@ class InputServer : public BApplication {
status_t _LoadKeymap();
status_t _LoadSystemKeymap();
status_t _SaveKeymap();
void _InitKeyboardMouseStates();
status_t _StartEventLoop();