Separate the Mouse and Touch Methods

grant

Member
CX Code Contributor
3rd Party Module Dev
Joined
Nov 19, 2019
Messages
81
Having the separate mouse and touchscreen methods would be more useful if they were separated completely. Right now pointer 0 on touchscreens and the mouse methods return the same values. Also this edit makes it so that on Android the MouseX/MouseY methods return updated values even when it's just hovering and not being held down.

This would cause backwards compatibility problems with old CXS code, so I'm not sure how you'd want to do this. Here is what I did on my personal Cerberus X installations. My edits are for the HTML and Android targets. IOS would need to be worked on.

 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,135
I am not a fan of breaking functionality.

Having the separate mouse and touchscreen methods would be more useful if they were separated completely.

Care to illustrate a use case?
 
Last edited:

grant

Member
CX Code Contributor
3rd Party Module Dev
Joined
Nov 19, 2019
Messages
81
Most of my games use different touch and mouse controls. Like a shooter game for example. I like to have the game auto detect witch input the player is using instead of asking them in a menu.

This change could be disabled by default and the game developer can enable if they need it.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
878
In the future (if gonna use SDL2) the idea of having mouse AND touch as separate entities might have another advantage for macOS, I'm not sure about Win10/11's precisionpad-standard, it might be different from macOS's touchpad in SDL2 ; namel, it allow you access to the touchpad absolute using multitouch. So the mouse could..behave like an old fashioned mouse with mousebuttons and everything else that goes into interpreting a classic touchpad surface, and touch could give the absolute coords.

It's very nice to be able to test touch on your macOS machine. Not that its a problem to upload to Android to test but it's a practical use-case why separate the commands.
 
Top Bottom