Subject: winex/windows/x11drv keyboard.c,1.24,1.25Update of /var/lib/cvsd/cvsroot/winex/windows/x11drv
In directory agravaine:/tmp/cvs-serv29771/windows/x11drv
Modified Files:
keyboard.c
Log Message:
Fix CAPSLOCK and NUMLOCK key handling. Call the normal keyboard message
sending routines when the keys are actually pressed, but do the state
synchronization when any other key is pressed in case the state of those
keys were changed outside of the app window.
Index: keyboard.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/windows/x11drv/keyboard.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- keyboard.c 29 Dec 2005 17:08:14 -0000 1.24
+++ keyboard.c 27 Apr 2007 12:56:55 -0000 1.25
@@ -940,32 +940,19 @@
if (vkey)
{
- switch (vkey & 0xff)
- {
- case VK_NUMLOCK:
- KEYBOARD_GenerateMsg( VK_NUMLOCK, 0x45, event->type, event_time );
- break;
- case VK_CAPITAL:
- TRACE("Caps Lock event. (type %d). State before : %#.2x\n",event->type,pKeyStateTable[vkey]);
- KEYBOARD_GenerateMsg( VK_CAPITAL, 0x3A, event->type, event_time );
- TRACE("State after : %#.2x\n",pKeyStateTable[vkey]);
- break;
- default:
+ WORD keyToSend = vkey & 0xff;
+ if (keyToSend != VK_NUMLOCK && keyToSend != VK_CAPITAL) {
+ /* Check CAPS and NUMLOCK state in case they were changed outside of wine */
X11DRV_KeyStateNotify( hwnd, event->time, event->state );
+ }
+ bScan = keyc2scan[event->keycode] & 0xFF;
+ TRACE_(key)("bScan = 0x%02x.\n", bScan);
- /* Not Num nor Caps : end of intermediary states for both. */
- NumState = FALSE;
- CapsState = FALSE;
-
- bScan = keyc2scan[event->keycode] & 0xFF;
- TRACE_(key)("bScan = 0x%02x.\n", bScan);
-
- dwFlags = 0;
- if ( event->type == KeyRelease ) dwFlags |= KEYEVENTF_KEYUP;
- if ( vkey & 0x100 ) dwFlags |= KEYEVENTF_EXTENDEDKEY;
-
- send_keyboard_input( vkey & 0xff, bScan, dwFlags, event_time );
- }
+ dwFlags = 0;
+ if ( event->type == KeyRelease ) dwFlags |= KEYEVENTF_KEYUP;
+ if ( vkey & 0x100 ) dwFlags |= KEYEVENTF_EXTENDEDKEY;
+
+ send_keyboard_input( vkey & 0xff, bScan, dwFlags, event_time );
}
}
@@ -1697,7 +1684,7 @@
{
if (dead_char)
{
- MultiByteToWideChar(main_key_tab[kbd_layout].layout_cp, 0, &dead_char, 1, bufW, bufW_size);
+ MultiByteToWideChar(main_key_tab[kbd_layout].layout_cp, 0, (LPCSTR)&dead_char, 1, bufW, bufW_size);
ret = -1;
}
else
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.