(v00 08-27-22)
TO LOAD THIS PICO-8 CART, in immediate mode, type:
load #full_input_reader
.
Long overdue isn't it ?
A thorough program to not just read a single joystick but all 4-of them. The regular keyboard. Shift keys. Ctrl-keys. The mouse, all 3-buttons. And even the mighty mouse roller.
And to give the appropriate code for looking for them in direct code. As a bonus with the keyboard reader, you get to see the ASCII of the keypress additionally, although you can certainly search for stat(31)=="c"
it will of course react on the C
key being pressed, or its equivalent, \99
Although be careful with CTRL keystrokes. If you press CTRL+R for instance you will restart your program from the beginning, even if running a cart.
To reveal a keystroke that is both a combination of joystick and keyboard, just hold it down to see both. Give a little time for a duo-control to "cool" down once releasing it.
In all cases to read both keyboard and mouse you will need to have at the front of your code, poke(0x5f2d,1)
and you need only do this once.
everything else is contained within this cart.
If you have any questions or suggestions, feel free to let me know !
Beyond that, enjoy. :)
[Please log in to post a comment]