flibitijibibo / FNA-MGHistory

FNA - Accuracy-focused XNA4 reimplementation for open platforms
http://fna-xna.github.io/
246 stars 37 forks source link

[SDL] [GamePad] Some Microsoft keyboards detected as gamepads on Linux #288

Closed Epsicode closed 9 years ago

Epsicode commented 9 years ago

I've had a report from a player encountering issues using a Microsoft Wired Keyboard 600 on Linux: http://steamcommunity.com/app/270210/discussions/0/35222218945199624/#c627456486216833067

As it turns out, some MS keyboards are recognized as both joysticks and KB at the same time, and it constantly report gamepad directions keys as "pressed", obviously interfering with games and potentially making them unplayable (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/390959)

The player was able to fix the issues by configuring MonoGameMonoGameJoystick.cfg to disable all gamepad bindings, but maybe this particular issue could be detected by FNA and it should discard joysticks with an unusually high amount of axis and buttons, as it is handled by XMBC: https://github.com/xbmc/xbmc/blob/master/xbmc/input/SDLJoystick.cpp (search for "Microsoft Wired Keyboard 600").

What do you think?

flibitijibibo commented 9 years ago

I've done blacklists for SDL 1.2 titles and it's pretty much never worked out. I'm thinking about just removing the MonoGameJoystick fallback, since SDL_GameController has been adopted so well. The only thing we'd lose is input inversion, but we could bother Ryan and Sam about that.

flibitijibibo commented 9 years ago

I just pushed a test branch called nomorecfg:

https://github.com/flibitijibibo/FNA/tree/nomorecfg

This removes MonoGameJoystick in favor of requiring SDL_GameController mappings for all connected controllers. Test this out and see how it goes. (Hotplugging should be tested the hardest.)

flibitijibibo commented 9 years ago

Going to close this as a retroactive duplicate of #289. This specific issue is more of a problem with joystick drivers in general, so I think 289 will probably be the best possible fix for this (sadly).