UnicornConsole
UnicornConsole copied to clipboard
True keyboard mode
Something I felt terribly missing from the original Pico8 was the lack of true keyboard support. I had tons of ideas that I could just not implement because there was no real keyboard input (create a tiny terminal, text adventure, an OS etc.)
Could it be possible to have a true keyboard mode, either activated programatically or with an environment variable?
That would effectively extend PX8 to be a Fantasy Microcomputer in addition to a Fantasy Console!
Have you some example to have a better understanding ?
Basically a mode where when you boot, you don't have 2 joypads, but instead each key on the keyboard is a different event.
For example, instead of btn(4)
and btn(5)
being the two buttons on the controller for example, btn(n)
would represent the key of ASCII n
being pressed.
So if I want to make a game where you move using the W A S D keys (Z Q S D in France I think) I would have something like (in Python):
if btn(119): # or more easily btn(ord('w'))
# go up
elif btn(115):
# go down
...
It seems a good idea, I need to figure out how to do that
You could try this feature with: btn('a') or btnp('a') for example, it should work with python
- [X] Add API
- [X] Add python binding
- [ ] add the lua binding
- [ ] add the doc
@Tenchi2xh do you want to test it ?