Module: wine Branch: master Commit: ae2ce18fd669efb797e11ef0e614be309e83fd3f URL: http://source.winehq.org/git/wine.git/?a=commit;h=ae2ce18fd669efb797e11ef0e6...
Author: Ken Thomases ken@codeweavers.com Date: Mon Sep 9 22:37:36 2013 -0500
winemac: Don't allow dead-key state to repeat after characters are generated.
It's fairly common in Mac keyboard layouts that, if you type a dead key twice, the second key press will both produce a non-dead character and also perpetuate the dead-key state. For example, with the U.S. layout, Option-E, E will produce "�" and Option-E, Option-E, E will produce "��". Windows keyboard layouts don't tend to do this. The second key press produces the non-dead character and clears the dead-key state.
---
dlls/winemac.drv/keyboard.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index 98d17ba..cc25789 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1394,7 +1394,10 @@ INT CDECL macdrv_ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState } if (!is_menu) { - thread_data->dead_key_state = deadKeyState; + if (keyAction != kUCKeyActionUp && len > 0 && deadKeyState == thread_data->dead_key_state) + thread_data->dead_key_state = 0; + else + thread_data->dead_key_state = deadKeyState;
if (keyAction == kUCKeyActionUp) goto done;