dolphin/Source/Core/InputCommon/ControllerInterface
Jeffrey Bosboom c6f9e61d38 XInput2: Accept input from keyboards other than the first master
XInput2 was created to support multiple pointer/keyboard pairs (often
called MPX for multi-pointer X).  Dolphin's XInput2 implementation has
always supported MPX by creating a KeyboardMouse object per master
pointer.  Since commit bbb12a7, Dolphin's keyboard state is filtered by
the output of XQueryKeymap.  As a core X function, XQueryKeymap queries
"the" keyboard, which by default is the first master keyboard.  As a
result, Dolphin will ignore keys pressed on other master keyboards
unless the first master is simultaneously pressing the same keys.

XInput2 doesn't provide a function to query the keyboard state.  There
is no XIQueryKeymap and the current state is not a member of the
XIKeyClassInfo returned by XIQueryDevice.  Instead, XInput2 allows a
master pointer to be nominated as "the" pointer on a per-client basis,
with "the" keyboard automatically becoming the associated master
keyboard.  The "documentation" [1] says passing None for the window is
only for debugging purposes, but it is documented in the
XISetClientPointer man page and seems to be the only way to query
keyboards beyond the first.

With this commit, Dolphin correctly reads keys from keyboards other than
the first master keyboard.  To test, use the xinput command-line utility
to create a master pointer and reattach a keyboard to the associated
master keyboard.

[1]: https://who-t.blogspot.com/2009/07/xi2-recipes-part-6.html
     (the XInput2 developer's blog)
2023-04-13 20:10:00 -07:00
..
Android Android: Add the advanced input mapping dialog 2023-03-07 17:39:30 +01:00
DInput Merge pull request #10858 from AdmiralCurtiss/mouse-center-hotkey 2022-07-26 12:52:33 +02:00
DualShockUDPClient ControllerInterface: Fix uninitialized variables in DualShockUDPClient 2023-02-15 19:23:47 -08:00
evdev ControllerInterface: evdev InputBackend implementation. 2022-11-01 21:59:08 -05:00
ForceFeedback treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
OSX StripSpaces: only strip spaces 2022-07-25 18:40:12 -07:00
Pipes Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
Quartz InputCommon:QuartzKB&M: Fix mouse y coordinates 2022-12-31 23:42:11 -06:00
SDL InputCommon:SDL: Add SDL 2.26 left and right motion inputs 2022-11-24 15:12:07 -06:00
Touch ControllerInterface/Android: Rip out ButtonManager 2023-03-03 22:28:23 +01:00
WGInput WGInput: Work around crash with Steam overlay. 2022-09-07 21:06:26 +02:00
Wiimote WiimoteEmu: Update IR camera status from DesiredWiimoteState. 2022-10-02 23:14:35 +02:00
Win32 WGInput: use c++/winrt 2022-08-26 23:20:34 -07:00
XInput ControllerInterface: Update sort priorities. 2022-04-03 19:03:44 -05:00
Xlib XInput2: Accept input from keyboards other than the first master 2023-04-13 20:10:00 -07:00
ControllerInterface.cpp Merge pull request #11635 from Dentomologist/wiimote_fix_disconnection_deadlock 2023-03-14 02:41:36 +01:00
ControllerInterface.h ControllerInterface: Add InputBackend interface and SDL implementation. 2022-11-01 21:59:08 -05:00
CoreDevice.cpp ControllerInterface/Android: Implement sensor input for InputDevices 2023-03-03 22:28:23 +01:00
CoreDevice.h ControllerInterface/Android: Implement sensor input for InputDevices 2023-03-03 22:28:23 +01:00
InputBackend.cpp ControllerInterface: Add InputBackend interface and SDL implementation. 2022-11-01 21:59:08 -05:00
InputBackend.h ControllerInterface: Add InputBackend interface and SDL implementation. 2022-11-01 21:59:08 -05:00
MappingCommon.cpp MappingCommon: Fix detection of hotkey and conjunction expressions. 2022-03-16 22:25:04 -05:00
MappingCommon.h Move parts of MappingCommon out of DolphinQt 2022-03-06 14:30:49 +01:00