Hi,
I’ve received my DevTerm
and already I have a question. How do I read the state of the four arrow keys at the top left of the keyboard and the ‘game’ buttons (Y X B A) at the top right ?
Thanks,
Andrew
Hi,
I’ve received my DevTerm
and already I have a question. How do I read the state of the four arrow keys at the top left of the keyboard and the ‘game’ buttons (Y X B A) at the top right ?
Thanks,
Andrew
Those keys is a Joystick, not a normal keyboard.
I think you could use those keys in game playing, not is text editing, just like a normal seperated gamepad.
The defines in source code looks like this:
_JOYSTICK_UP, //B1 //Joystick.Y()
_JOYSTICK_DOWN, //Joystick.Y()
_JOYSTICK_LEFT, //Joystick.X()
_JOYSTICK_RIGHT, //Joystick.X()
_JOYSTICK_A, //Joystick.button(1)
_JOYSTICK_B, //Joystick.button(2)
_JOYSTICK_X, //Joystick.button(3)
_JOYSTICK_Y, //Joystick.button(4)
Can confirm. In SDL games these keys behave as if you have a generic gamepad/joystick attached.
If you want keyboard keypress you have to move one of the switch on the back.
I would like to use them in my own programs. Is there a library, or header file I can use ? If so where Will I find them ?
It does show up as a normal USB joypad, there is nothing special other than accessing a joystick
Exemple, if you use SDL, it should directly use the Joypad/Joystick related functions
I found this:
https://www.kernel.org/doc/Documentation/input/joystick-api.txt
Which answered most of my questions, plus I installed a package (joystick) which contains “jstest” run this and press buttons, you can see the results.
Thanks for the tips.
Could you link to where this is documented?
Hi @andypiper, I’ve also been looking around for the documention. I think I found the git commit where they added the switch condition though! here is the commit to the clockwork/DevTerm repo
Thanks, I haven’t been able to find very much information on the switches on the keyboard in general, apart from reading through these threads and learning, which is why I was asking appreciate the sleuthing.
It is not, but you can find it by looking at the keyboard code. that’s why I shared it here.