Commit Graph

151 Commits

Author SHA1 Message Date
Jacek Caban 10f38c0600 winex11: Move user driver to unixlib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:22 +02:00
Jacek Caban 6dd08c34dc winex11: Use wcsicmp for string comparison.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:22 +02:00
Jacek Caban c736411fb8 winex11: Directly use ntdll in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:01:13 +02:00
Jacek Caban c0a8b2dbd5 winex11: Use ntdll_umbstowcs and ntdll_wcstoumbs for Unicode conversion.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-03 19:01:13 +02:00
Jacek Caban ef8e4b7e3e winex11: Use libc for driver memory allocation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:34:55 +02:00
Timo Zuccarello a54755c87c winex11.drv: Do not assign reserved virtual key 0xE0 to key codes.
Signed-off-by: Timo Zuccarello <timo@zuccarello.eu>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-21 14:43:54 +02:00
Jacek Caban b2bc410b7c winex11: Use pthread for keyboard lock.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-18 20:58:59 +02:00
Jacek Caban 262831bc63 winex11: Directly use win32u in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-15 20:54:36 +02:00
Jacek Caban f6524f7a3a win32u: Don't use CDECL for user driver functions.
They are no longer used from PE code.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-07 22:44:39 +02:00
Giovanni Mascellani 2a505efb1c winex11.drv: Do not pollute logs with misencoded bytes.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 23:38:44 +02:00
Giovanni Mascellani 054b7c8204 winex11.drv: Allow keyboard layout score to be negative.
The keyboard layout matching algorithm can assign a negative score
to a keyboard layout. If the user has a strange keyboard layout,
possibly a custom one, it might happen that all keyboard layouts
known by Wine get a negative score. This is not an error in itself,
and we should still strive to find the best match.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 23:38:44 +02:00
Rémi Bernon 4bec69b104 user32: Move (Un)LoadKeyboardLayoutW from winex11.drv to user32.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Rémi Bernon 512112ebd5 user32: Set keyboard layout preload key on init.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-06 20:00:42 +02:00
Rémi Bernon c4e6d16271 user32: Factor GetKeyboardLayoutNameW implementations.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-06 19:50:40 +02:00
Rémi Bernon e2aa30f21d user32: Factor GetKeyboardLayout and remove driver call.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:57:53 +02:00
Rémi Bernon da9fc41814 user32: Factor ActivateKeyboardLayout previous layout logic.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:57:04 +02:00
Rémi Bernon f044f401f7 user32: Factor unsupported cases into ActivateKeyboardLayout.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:08:23 +02:00
Rémi Bernon 123c17aa92 user32: Add RAWINPUT parameter to __wine_send_input.
And send_hardware_message.

This makes it possible to use __wine_send_input to send extended input
data, such as HID device notifications and WM_INPUT messages carrying
HID reports.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 10:37:52 +02:00
Rémi Bernon 6444e4fade server: Remove tid from set_key_state request.
As it is always set to GetCurrentThreadId().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 22:51:50 +02:00
Rémi Bernon 626870abe2 server: Remove tid from get_key_state request.
And replace it with an async param if we want the global async keystate.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 22:51:21 +02:00
Derek Lesho bc02e8551f winex11: Set the scan code prefix when necessary.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-02 22:02:56 +01:00
Zebediah Figura 1bc9c4fdb2 winex11: Update the state of all keys on KeymapNotify.
The Binding of Isaac transitions in and out of fullscreen when the "F" key is
pressed. Specifically, it will swap states when receiving WM_KEYDOWN,
provided that the previous key state was not pressed (i.e. bit 30 is 0).
However, as part of the process of transitioning, it hides and shows its
window, causing it to temporarily lose focus. If the F key is released while
the window does not have focus, Wine misses this fact, and thinks that the
key was already pressed the next time it is pressed, causing the game to
refuse to change focus. Windows will not deliver WM_KEYUP messages to a
window that does not have focus, but it will always report the true previous
state of any key on the keyboard when requested.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-18 23:51:52 +02:00
Zebediah Figura 178d2c5768 winex11: Remove redundant calls to update_key_state().
These will not actually do anything, and were probably added by mistake,
after the similar calls to VK_CONTROL et al. above.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-18 23:51:52 +02:00
Piotr Caban b8f0a28e8c winex11.drv: Don't use strcasecmp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-03 20:27:57 +02:00
Jacek Caban cbc657a244 winex11.drv: Force changing lock keys state if hooks blocked keyboard input processing.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-23 15:51:21 +02:00
Akihiro Sagawa 8743188f5d winex11: Fix Japanese 106 keyboard scan/vkey code tables.
Otherwise, some symbol keys (e.g. backslash) map differently.
As a result, jp106's scan code and vkey tables equal to macjp.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-17 16:51:02 +02:00
Alex Henrie 5c06eba58e winex11: Escape non-UTF-8 characters in string literals.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-04 21:46:59 +01:00
Akihiro Sagawa 08b531ed0d winex11: Add Japanese special key support.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-01 20:32:56 +01:00
Akihiro Sagawa ce7a98e95c winex11: Return more reliable value from X11DRV_MsgWaitForMultipleObjects.
After processing several X events, X11DRV_MsgWaitForMultipleObjects always
tells us that a new message is available. This is not true for some cases.

For instance, when we call DestroyWindow, the X queues DestroyEvent. Then,
X11DRV_MsgWaitForMultipleObjects handles the event only; none is posted or
sent as hwnd for destroyed window is unavailable. However, the function
states "new message is available" by returning count - 1 value.

This is an issue for CoWaitForMultipleHandles because it expects a new
message in the queue and consumes the message.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 22:27:40 +09:00
Nils Kuhnhenn 1def1e2f7f winex11.drv: Return default locale in LoadKeyboardLayout stub instead of 0.
Signed-off-by: Nils Kuhnhenn <kuhnhenn.nils@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-17 13:38:35 +09:00
Hugh McMaster 598d334e73 winex11.drv: Ctrl-Space should generate space, not 0.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-01 21:09:56 +09:00
Gerald Pfeifer 2b42ddf68a winex11: Make a constant unsigned to avoid shift overflow in get_locale_kbd_layout. 2015-09-02 18:33:46 +09:00
Dmitry Timoshkov a02c3ae759 winex11.drv: On KeymapNotify event also sychronize WinKey state. 2015-07-14 14:40:59 +09:00
Huw Davies 10556c25e4 winex11: Fix ctrl-<symbol> to generate codes below 0x20 where necessary. 2015-05-28 22:44:11 +09:00
Francois Gouget 3adc91f3fc winex11.drv: Remove unneeded NONAMELESSXXX directives. 2015-04-01 14:13:09 +09:00
Alexandre Julliard 710858abee winex11: Remove the no longer needed GetAsyncKeyState entry point. 2012-10-15 15:25:01 +02:00
Alexandre Julliard 03d377eae7 winex11: Release the keyboard lock before sending input to the server. 2012-08-17 10:06:41 +02:00
Alexandre Julliard 26fb3d4a69 winex11: Add a critical section to protect the keyboard mapping tables. 2012-08-16 16:43:19 +02:00
Alexandre Julliard 6bfcb347bf winex11: Remove X11 locking around simple X calls. 2012-08-14 15:13:08 +02:00
Ken Thomases 51d5a48c37 winex11: Fix correspondence between main_key_LT_B and main_key_vkey_qwerty. 2012-06-12 10:27:24 +02:00
Ken Thomases 43984f355a winex11: Be more conservative when matching keys from built-in layout tables. 2012-06-01 14:29:12 +02:00
Alexandre Julliard c8a22a4d1f winex11: Use XGetKeyboardMapping instead of XKeycodeToKeysym. 2012-06-01 14:29:02 +02:00
Dmitry Timoshkov 8ed11d8bb1 winex11.drv: Use XK_KP_Decimal as a fallback if XK_KP_Separator doesn't work. 2012-05-08 09:43:45 +02:00
Dmitry Timoshkov bdae6d7dc0 winex11.drv: Windows always generates VK_DECIMAL for Del/. on a keypad. 2012-04-24 19:12:32 +02:00
Alexandre Julliard f87191815d user32: Fix GetKeyNameText returned length. 2012-02-15 12:07:34 +01:00
Alexandre Julliard 36c76dcc24 winex11: Update only the key state on KeymapNotify without sending fake key events. 2012-02-02 17:19:34 +01:00
Aric Stewart f624876d3e winex11: Strip the _L or _R from X11DRV_GetKeyNameText when appropriate. 2012-01-23 17:05:11 +01:00
Ken Thomases 3fa4da76ea winex11: Have ToUnicodeEx null-terminate the output buffer, if there's room. 2011-12-20 10:15:16 +01:00
Andrew Talbot 53a8746dcd winex11.drv: Mark some fall-throughs in switch statements. 2011-10-18 15:11:12 +02:00
Francois Gouget 076f678446 winex11: Fix printing NULL strings. 2011-09-20 16:21:39 +02:00