libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.31k stars 1.84k forks source link

OSX and Windows: Using trackpad as touchscreen on DeSmuME #3042

Open ddnava opened 8 years ago

ddnava commented 8 years ago

Playing NDS games can be difficult on a computer, so instead of pointing and clicking, a great alternative would be to map the trackpad to the NDS touchscreen. I know it's possible (at least on OSX) because Apple let's users use the trackpad to sign e-mails and there are some third-party apps that use it in a similar fashion, like Inklet, which uses the trackpad to draw. I know it would be awkward on some games, but some others like Metroid Prime Hunters and Mario Slam Basketball would really benefit of it.

Edit: I found this thread showing how to retrieve absolute trackpad coordinates for OS X: http://stackoverflow.com/questions/3573276/know-the-position-of-the-finger-in-the-trackpad-under-mac-os-x

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34661919-osx-and-windows-using-trackpad-as-touchscreen-on-desmume?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github).
dankcushions commented 8 years ago

I looked into the trackpad for another purpose, and gave up, but for anyone else: the trackpad on macbooks counts as a RETRO_DEVICE_POINTER, but it doesn't populate the coords unless you click the trackpad, or click and drag. This is because the current cocoa input driver seems to only want to update pointers when there's a 'touch', but it only counts an actual click as a 'touch'.

There's a few trackpad-specific NS events that probably need to be used for trackpads to track touches properly: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html

having said that, for something like the NDS, maybe the current behaviour is right, where you need to click and drag to get it to register? I think it might just be a matter of implementing RETRO_DEVICE_POINTER in the DS core.