From 676d27510df28a8a9b7f456b889dc9ed676b5604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 24 Oct 2009 00:31:04 +0000 Subject: [PATCH] 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33750 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../devices/keyboard/KeyboardInputDevice.cpp | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp index b1e83644d9..005ce805fa 100644 --- a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp +++ b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp @@ -706,7 +706,7 @@ KeyboardDevice::_ControlThread() } uint8 newDeadKey = 0; - if (activeDeadKey == 0) + if (activeDeadKey == 0 || !isKeyDown) newDeadKey = fKeymap.IsDeadKey(keycode, fModifiers); if (newDeadKey == 0) { @@ -757,11 +757,16 @@ KeyboardDevice::_ControlThread() 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 @@ KeyboardDevice::_ControlThread() 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; }