Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wminput crashes on classic controller button click #6

Open
HaraldKorneliussen opened this issue Mar 2, 2010 · 2 comments
Open

wminput crashes on classic controller button click #6

HaraldKorneliussen opened this issue Mar 2, 2010 · 2 comments

Comments

@HaraldKorneliussen
Copy link

Hi,

Great to see this project is maintained again, I pulled the latest version to see if a certain bug was fixed, sadly it wasn't.

What I do is this:

  1. Edit the gamepad config file, change the line CLASSIC.A = BTN_A to CLASSIC.A = KEY_A.
  2. Start wminput (I just run it with sudo to work around uinput permissions issue - maybe not the best idea) and connect successfully to wiimote with Classic controller attached (it works fine with wmgui)
  3. Press the A button on the classic controller
  4. Whoops, X crashes.

What I really wanted to do was make one of the analog sticks work as a mouse, but I couldn't get it to register anything at all. The moment I change anything in the config file, this happens.

@tuomasjjrasanen
Copy link
Contributor

Confirmed but unfortunately it has nothing to do with libcwiid nor wminput. I just experimented a bit, and it seems that it's a bug in Xorg. I was able to reproduce the crash without any dependency to cwiid whatsoever.

Steps to reproduce:

  1. Create an uinput device.
  2. Enable a relative or an absolute axis.
  3. Enable a key from AT key set. (KEY_ prefixes).
  4. Send a EV_KEY event.

If any AT key is enabled, the device is handled as a keyboard.

If a relative axis was enabled, crashing can be avoided by registering one standard mouse button (BTN_MOUSE for example). It seems, that whenever a device has two relative axes and at least one mouse button, it is handled as mouse. However, I have no idea why this affects the crash behavior. It is quite odd that just enabling some capabilities causes the device to become a crash cannon..

There is something really wrong in Xorg's capability checking.. this should be reported to Xorg.

@HaraldKorneliussen
Copy link
Author

Big thanks for confirming this and tracking it down! I'm not sure I do the workaround correctly, though. I change Classic.Home to BTN_MOUSE, and remove the ones with KEY_ prefixes, but I can still crash it - whether the axes are set to relative or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants