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:
@@ -40,6 +40,7 @@
|
|||||||
#define SYSTEM_SHUTTING_DOWN 'SSDn'
|
#define SYSTEM_SHUTTING_DOWN 'SSDn'
|
||||||
|
|
||||||
#define IS_SAVE_SETTINGS 'Isst'
|
#define IS_SAVE_SETTINGS 'Isst'
|
||||||
|
#define IS_SAVE_KEYMAP 'Iskp'
|
||||||
|
|
||||||
// app_server communication
|
// app_server communication
|
||||||
#define IS_ACQUIRE_INPUT 'Iaqi'
|
#define IS_ACQUIRE_INPUT 'Iaqi'
|
||||||
|
|||||||
@@ -322,6 +322,13 @@ InputServer::_LoadSystemKeymap()
|
|||||||
memcpy(fChars, kSystemKeyChars, fCharsSize);
|
memcpy(fChars, kSystemKeyChars, fCharsSize);
|
||||||
|
|
||||||
// TODO: why are we doing this?
|
// TODO: why are we doing this?
|
||||||
|
return _SaveKeymap();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
InputServer::_SaveKeymap()
|
||||||
|
{
|
||||||
// we save this keymap to file
|
// we save this keymap to file
|
||||||
BPath path;
|
BPath path;
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) != B_OK)
|
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) != B_OK)
|
||||||
@@ -585,6 +592,10 @@ InputServer::MessageReceived(BMessage* message)
|
|||||||
fMouseSettings.SaveSettings();
|
fMouseSettings.SaveSettings();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case IS_SAVE_KEYMAP:
|
||||||
|
_SaveKeymap();
|
||||||
|
return;
|
||||||
|
|
||||||
case B_SOME_APP_LAUNCHED:
|
case B_SOME_APP_LAUNCHED:
|
||||||
{
|
{
|
||||||
const char *signature;
|
const char *signature;
|
||||||
@@ -738,6 +749,8 @@ InputServer::HandleSetModifierKey(BMessage* message, BMessage* reply)
|
|||||||
|
|
||||||
// TODO: unmap the key ?
|
// TODO: unmap the key ?
|
||||||
|
|
||||||
|
be_app_messenger.SendMessage(IS_SAVE_KEYMAP);
|
||||||
|
|
||||||
BMessage msg(IS_CONTROL_DEVICES);
|
BMessage msg(IS_CONTROL_DEVICES);
|
||||||
msg.AddInt32("type", B_KEYBOARD_DEVICE);
|
msg.AddInt32("type", B_KEYBOARD_DEVICE);
|
||||||
msg.AddInt32("code", B_KEY_MAP_CHANGED);
|
msg.AddInt32("code", B_KEY_MAP_CHANGED);
|
||||||
@@ -752,6 +765,8 @@ status_t
|
|||||||
InputServer::HandleSetKeyboardLocks(BMessage* message, BMessage* reply)
|
InputServer::HandleSetKeyboardLocks(BMessage* message, BMessage* reply)
|
||||||
{
|
{
|
||||||
if (message->FindInt32("locks", (int32*)&fKeys.lock_settings) == B_OK) {
|
if (message->FindInt32("locks", (int32*)&fKeys.lock_settings) == B_OK) {
|
||||||
|
be_app_messenger.SendMessage(IS_SAVE_KEYMAP);
|
||||||
|
|
||||||
BMessage msg(IS_CONTROL_DEVICES);
|
BMessage msg(IS_CONTROL_DEVICES);
|
||||||
msg.AddInt32("type", B_KEYBOARD_DEVICE);
|
msg.AddInt32("type", B_KEYBOARD_DEVICE);
|
||||||
msg.AddInt32("code", B_KEY_LOCKS_CHANGED);
|
msg.AddInt32("code", B_KEY_LOCKS_CHANGED);
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ class InputServer : public BApplication {
|
|||||||
|
|
||||||
status_t _LoadKeymap();
|
status_t _LoadKeymap();
|
||||||
status_t _LoadSystemKeymap();
|
status_t _LoadSystemKeymap();
|
||||||
|
status_t _SaveKeymap();
|
||||||
void _InitKeyboardMouseStates();
|
void _InitKeyboardMouseStates();
|
||||||
|
|
||||||
status_t _StartEventLoop();
|
status_t _StartEventLoop();
|
||||||
|
|||||||
Reference in New Issue
Block a user