dolphin/Source/Core
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
..
AudioCommon Common: Move FixedSizeQueue into Common namespace 2023-03-22 01:23:15 -04:00
Common Merge pull request #11687 from Minty-Meeo/warnings 2023-04-14 01:29:46 +01:00
Core Merge pull request #11687 from Minty-Meeo/warnings 2023-04-14 01:29:46 +01:00
DiscIO NANDImporter: Check data bounds. 2023-04-02 03:45:34 +02:00
DolphinNoGUI Merge pull request #11522 from phire/KillRendererWithFire 2023-02-09 19:59:16 +13:00
DolphinQt Merge pull request #11687 from Minty-Meeo/warnings 2023-04-14 01:29:46 +01:00
DolphinTool Merge pull request #11522 from phire/KillRendererWithFire 2023-02-09 19:59:16 +13:00
InputCommon XInput2: Accept input from keyboards other than the first master 2023-04-13 20:10:00 -07:00
MacUpdater CMake: Use proper dependency tracking command for storyboard compiling 2023-03-17 01:28:33 -05:00
UICommon JitInterface: Refactor to class, move to System. 2023-03-26 14:38:07 +02:00
UpdaterCommon Resolve [-Wdeprecated-declarations] 2023-04-12 03:59:57 -05:00
VideoBackends CMake: Check WIN32 instead of CMAKE_SYSTEM_NAME STREQUAL Windows 2023-04-06 18:37:45 -07:00
VideoCommon Merge pull request #11687 from Minty-Meeo/warnings 2023-04-14 01:29:46 +01:00
WinUpdater WinUpdater: Quote path for args when relaunching Dolphin. 2023-03-17 12:48:39 +01:00
CMakeLists.txt CMakeLists: Add option to disable automatic update support 2022-03-18 03:04:51 -04:00
DolphinLib.ARM64.props msbuild: use default Project attrs 2022-04-27 15:26:43 -07:00
DolphinLib.props Common: Rename ENetUtil.cpp/.h to ENet.cpp/.h 2023-04-11 11:48:46 -04:00
DolphinLib.vcxproj Added rcheevos to Externals 2023-04-02 08:28:23 -04:00
DolphinLib.vcxproj.user msbuild: use default Project attrs 2022-04-27 15:26:43 -07:00
DolphinLib.x64.props Move x64 DSP JIT into DolphinLib.x64.props 2023-01-06 22:42:21 -08:00