From 034a4d2e0da6e6d962f3fd27b7079c2641bfa663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 8 Jan 2005 01:50:11 +0000 Subject: [PATCH] we now keep a copy of modifiers and key_states around to be able to fill incomplete messages and get_key_info requests because of this, 4th bug from axeld is fixed, and R5 Keymap preferences is now working correctly git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10613 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/input/InputServer.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index c30263e50c..d0717931d3 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -227,7 +227,7 @@ InputServer::InitKeyboardMouseStates(void) { CALLED(); // This is where we determine the screen resolution from the app_server and find the center of the screen - // sMousePos is then set to the center of the screen. + // fMousePos is then set to the center of the screen. fFrame = fScreen.Frame(); fMousePos = BPoint(fFrame.right/2, fFrame.bottom/2); @@ -767,9 +767,20 @@ InputServer::HandleSetMousePosition(BMessage *message, BMessage *outbound) break; // some Key Down and up codes .. + case B_KEY_DOWN: + case B_KEY_UP: + case B_UNMAPPED_KEY_DOWN: + case B_UNMAPPED_KEY_UP: + case B_MODIFIERS_CHANGED: { + ssize_t size; + uint8 *data; + outbound->FindInt32("modifiers", (int32*)&fKey_info.modifiers); + if ((outbound->FindData("states", B_UINT8_TYPE, (const void**)&data, &size) == B_OK) + && (size == (ssize_t)sizeof(fKey_info.key_states))) + memcpy(fKey_info.key_states, data, size); + } default: - break; - + break; } return B_OK;