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

Mouse Coordinates Not Detected #7697

Open
blisstik opened this issue Dec 4, 2018 · 21 comments
Open

Mouse Coordinates Not Detected #7697

blisstik opened this issue Dec 4, 2018 · 21 comments

Comments

@blisstik
Copy link

blisstik commented Dec 4, 2018

Description

According to this page, event indexes should be used for using a mouse.
https://github.com/RetroPie/RetroPie-Setup/wiki/Spinners,-Trackballs,-Lightguns,-and-other-Mouse-Devices

Here is the a log of a game with the mouse attached. As you can see the Mouse #0 is attached to event2. In RetroArch Input settings, I set the User 1 Mouse Index to 0 and I'm able to map the mouse buttons.

The problem is I'm not able to get any coordinate movements from the mouse. There is a warning about Full-screen pointer won't be available. What is causing this issue?

https://pastebin.com/raw/A5e7eDLR

...
[INFO] [udev]: Mouse #0 (/dev/input/event2).
[INFO] [udev]: Mouse #1 (/dev/input/mouse0).
[INFO] [udev]: Plugged pad: MadCatz Madcatz Fightpad (1848:12933) on port #0.
[INFO] [udev]: Pad #0 (/dev/input/event0) supports 0 force feedback effects.
[INFO] [Autoconf]: 3 profiles found.
[INFO] [autoconf]: selected configuration: /home/pigaming/.config/retroarch/autoconfig/MadCatz Madcatz Fightpad.cfg
[INFO] [Joypad]: Found joypad driver: "udev".
[WARN] [udev]: Full-screen pointer won't be available.
...

Expected behavior

Mouse coordinates to move.

Actual behavior

Mouse coordinates are not moving but mouse buttons can be mapped without issue. I've ran a test using advmame and the coordinates move for the advmame test.

https://pastebin.com/raw/JRbHiH0T

Steps to reproduce the bug

On an Odroid XU4, using the ORA v1.5.2 image

  1. Update RetroPie-Setup script
  2. Update RetroArch
  3. Update lr-reicast
  4. Attach a mouse
  5. Launch a game like Sports Shooting USA

Version/Commit

  • retroarch - bd64deb
  • lr-reicast - a45420f

Environment information

  • OS: Ubuntu 16.04.3 LTS (GNU/Linux 3.10.105-141 armv7l)
@singularity098
Copy link

singularity098 commented Dec 5, 2018

Hi. I came here to log what I believe is this same issue, but glad to see someone else had written it up, and just recently. I wanted to share some more information and ask if you could confirm that information on your system to see if we can help narrow this down.

What I noticed is that I cannot map the mouse movement at all, as you have said. I started to wonder if this was core-specific or platform specific. Here is what I found in testing:

MAME (git core, v0.203): Fail
MAME 2016: Fail
MAME 2014: Fail
MAME 2010: Pass! I can use the mouse/trackball in games like Centipede.
Final Burn Alpha: Fail
SNES9x: Pass! I was able to play Mario Paint after selecting mouse in the core specific input options.

Interesting... Additionally, I tested some other environments. This was my result:

RetroArch 1.7.5 in Ubuntu 18.10: Failures as described above
RetroArch 1.7.3 in Lakka 2.1.1: Failures as described above
RetroArch 1.7.5 in Windows 10: Pass! I did not experience any of the core-specific issues described above, the mouse works in all of the cores.

Is any of this consistent with what you're seeing? Thank you, sir. I hope this issue can get resolved!

@blisstik
Copy link
Author

blisstik commented Dec 6, 2018

The only other game I tried was Terminator 2 using lr-mame2003-plus. Oddly enough, the pointer only worked vertically.

@ghost

This comment was marked as spam.

@blisstik
Copy link
Author

blisstik commented Dec 12, 2018 via email

@ghost

This comment was marked as spam.

@blisstik
Copy link
Author

This did not fix the issue. Mouse buttons work but still will not move.

@ghost

This comment was marked as spam.

@singularity098
Copy link

singularity098 commented Dec 15, 2018

If you load a game in MAME, and then pull up the quick menu, then proceed to the core specific "Options", do you see an option for "Enable in-game mouse" which is turned to off?

Turns out this was the source of the issue for me. This option was turned off by default in the git (most recent) MAME core for Linux, but not for MAME 2010.... odd.

I wonder why that would be set to "off" by default, and I wonder if the default value there could be changed.

@ghost

This comment was marked as spam.

@blisstik
Copy link
Author

I tried fceumm with Duck Hunt and I was able to get it to work. I didn't have to compile RetroArch with the PR.

@ghost

This comment was marked as spam.

@blisstik
Copy link
Author

blisstik commented Dec 15, 2018 via email

@ghost

This comment was marked as spam.

@blisstik
Copy link
Author

blisstik commented Dec 15, 2018 via email

@ghost

This comment was marked as spam.

@blisstik
Copy link
Author

blisstik commented Dec 15, 2018 via email

@blisstik
Copy link
Author

blisstik commented Dec 15, 2018 via email

@ghost

This comment was marked as spam.

@barbudreadmon
Copy link
Contributor

On odroid, fbalpha is working as expected with games using analogs when setting mouse as control, i'll try to hook the pointer/lightgun libretro device (they are basically the same) this week-end to see if i'm experiencing issues on my odroid with it.

@barbudreadmon
Copy link
Contributor

The pointer is also working as expected in fbalpha, so the issue might be with the cores indeed, a wild guess would be some type conversion going bad on arm, 2 related issues i had to deal with in the past :

  • char, which is unsigned by default (unlike x86)
  • implicit conversion of negative float to unsigned int

@barbudreadmon
Copy link
Contributor

barbudreadmon commented Apr 6, 2019

Ok, i figured out the issue, i'll go into details, there are 3 ways to deal with mouse/pointer/lightgun devices in RA :

  • using RETRO_DEVICE_MOUSE, it's detecting mouse relative movements, basically it works like an analog stick
  • using RETRO_DEVICE_POINTER, it's detecting mouse/touch absolute position, so you can set the cursor in the game directly to coordinates
  • using RETRO_DEVICE_LIGHTGUN, it's detecting lightgun absolute position, so you can set the cursor in the game directly to coordinates

The deal here is that we are using RETRO_DEVICE_LIGHTGUN in lr-reicast (and probably in a lot of other cores), because mouse is actually able to emulate a lightgun on a desktop computer (might be something related to the usage of a window manager system, or some specific code in RA, idk), but on odroid (and probably some other platforms) the mouse doesn't seem to emulate the lightgun, so we'll have to implement a RETRO_DEVICE_POINTER device as a workaround to get this stuff to work.

Edit : It seems to be related to the usage of a window manager system indeed, maybe it would work on wayland with the current code ? A proper way to fix this would be to backport 7dfcc16#diff-70ed405993338684f64b3107991cbc8e to the RA udev driver.

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

No branches or pull requests

4 participants