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

RETRO_DEVICE_MOUSE and RETRO_DEVICE_POINTER not working properly with OSX #3190

Open
dankcushions opened this issue Jul 4, 2016 · 1 comment

Comments

@dankcushions
Copy link
Contributor

dankcushions commented Jul 4, 2016

In the test core I only get readings readings from the mouse retrieval code (https://github.com/libretro/RetroArch/blob/master/cores/libretro-test/libretro-test.c#L219) when either the left mouse button (for RETRO_DEVICE_MOUSE) is held, or the trackpad (RETRO_DEVICE_POINTER) is held.

This behaviour is wrong for RETRO_DEVICE_MOUSE - according to https://github.com/libretro/RetroArch/blob/master/libretro-common/include/libretro.h#L119 it should report the delta as long as the mouse cursor is in the window. You shouldn't need to click and hold.

It is also wrong for RETRO_DEVICE_MOUSE - according to https://github.com/libretro/RetroArch/blob/master/libretro-common/include/libretro.h#L158 it should report as long as the touchpad is touched. On a mac trackpad, you can touch to move the cursor around without having to click the pad. So, RETRO_DEVICE_POINTER_PRESSED should be set as long as there is a touch event.

As far as I can tell, the problem is that the current cocoa input driver only reads out the x/y of pointer/mouse, when touch_count > 1 (see

for (i = 0; i < apple->touch_count; i++)
for mouse and
if (idx < apple->touch_count && (idx < MAX_TOUCHES))
for pointer), but, it only sets touch_count = 1 when the mouse is clicked:
case NSOtherMouseDown:

I think the mouse could be fixed in the existing code - I will try that soon, but the pointer is different - current driver doesn't handle trackpad touch events at all, really, just the behaviour of the mouse when you use the trackpad (which is why it doesn't set touch_count until the pad is clicked rather than touched, as the mouse has no concept of touching).

Really it should be using the NSTouch object, which contains all the touch data (if it's touched, how many figures, etc), but I couldn't get it working :)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@dankcushions dankcushions changed the title RETRO_DEVICE_MOUSE not working with OSX RETRO_DEVICE_MOUSE and RETRO_DEVICE_POINTER not working properly with OSX Sep 1, 2016
@dankcushions
Copy link
Contributor Author

I've updated this issue with some new findings, but I'm not able to get anywhere with the trackpad stuff as it requires objective-c and cocoa knowledge, which i'm struggling with! Hopefully someone else does!

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

3 participants