[haiku-commits] r33750 - haiku/trunk/src/add-ons/input_server/devices/keyboard

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 24 Oct 2009 02:31:04 +0200 (CEST)

Author: korli
Date: 2009-10-24 02:31:04 +0200 (Sat, 24 Oct 2009)
New Revision: 33750
Changeset: http://dev.haiku-os.org/changeset/33750/haiku

Modified:
   haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
Log:
Fixed the dead key misbehavior when typing fast: we don't change the deadkey 
status on key up anymore.
I thought there was a ticket about this bug, but couldn't find it.


Modified: 
haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp   
    2009-10-23 23:03:49 UTC (rev 33749)
+++ 
haiku/trunk/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp   
    2009-10-24 00:31:04 UTC (rev 33750)
@@ -706,7 +706,7 @@
                }
 
                uint8 newDeadKey = 0;
-               if (activeDeadKey == 0)
+               if (activeDeadKey == 0 || !isKeyDown)
                        newDeadKey = fKeymap.IsDeadKey(keycode, fModifiers);
 
                if (newDeadKey == 0) {
@@ -757,11 +757,16 @@
 
                        delete[] rawString;
 
-                       if (isKeyDown && !modifiers && activeDeadKey != 0
-                               && fInputMethodStarted) {
+                       if (isKeyDown && !modifiers && activeDeadKey != 0) {
                                // a dead key was completed
-                               
_EnqueueInlineInputMethod(B_INPUT_METHOD_CHANGED,
-                                       string, true, msg);
+                               activeDeadKey = 0;
+                               if (fInputMethodStarted) {
+                                       
_EnqueueInlineInputMethod(B_INPUT_METHOD_CHANGED,
+                                               string, true, msg);
+                                       
_EnqueueInlineInputMethod(B_INPUT_METHOD_STOPPED);
+                                       fInputMethodStarted = false;
+                               } else if (fOwner->EnqueueMessage(msg) != B_OK)
+                                       delete msg;
                        } else if (fOwner->EnqueueMessage(msg) != B_OK)
                                delete msg;
                } else if (isKeyDown) {
@@ -773,18 +778,10 @@
 
                                if 
(_EnqueueInlineInputMethod(B_INPUT_METHOD_CHANGED, string) == B_OK)
                                        fInputMethodStarted = true;
+                               activeDeadKey = newDeadKey;
                        }
                }
 
-               if (!isKeyDown && !modifiers) {
-                       if (activeDeadKey != 0) {
-                               
_EnqueueInlineInputMethod(B_INPUT_METHOD_STOPPED);
-                               fInputMethodStarted = false;
-                       }
-
-                       activeDeadKey = newDeadKey;
-               }
-
                lastKeyCode = isKeyDown ? keycode : 0;
        }
 


Other related posts:

  • » [haiku-commits] r33750 - haiku/trunk/src/add-ons/input_server/devices/keyboard - korli