nesbox / TIC-80

TIC-80 is a fantasy computer for making, playing and sharing tiny games.
https://tic80.com
MIT License
4.95k stars 482 forks source link

[request enhancement] mouse button events #2401

Open atesin opened 9 months ago

atesin commented 9 months ago

hi... currently, mouse() function only tells if mouse buttons are pressed or not, raw... i was trying to emulate mouse button/touch events, with each 3 button, like:

these events could be dependent on host system settings (double click velocity, tap and hold dragging for touch devices, tap 2 fingers, etc)

i am trying to figure out a way/function to emulate these events, but i see could be long and complicated code, and will not be system dependent

in the meanwhile, does enybody know some snippet code/function to emulate these events?.. thanks

atesin commented 9 months ago

hi .... maybe someone already had developed a library for this... but the current website state makes difficult to search for it, there are plenty of reports/suggestions about this, like #2415 and #2416 .... maybe this lib could be easily found by searching carts for "mouse"

i dont want to reinvent the wheel either

joshgoebel commented 9 months ago

IMHO definitely like something that would need to be a library... the core built-ins are largely about interfacing directly with the hardware when it comes to input. I think this is simply out of scope.

potato25 commented 8 months ago

I just would it to be able to identify mouse click and press , like button and button press. Double click would help too 🤔