Page 1 of 4

Teensy: Keyboard vs Joystick Decision

Posted: Thu May 05, 2016 11:51 pm
by chiz
@Wermy

As I was testing the Teensy using my "chiz-built common ground dmg button", I came to realize that since the Teensy was programmed as USB keyboard rather than a USB controller/gamepad, it would only register one keypress at a time and will not allow more than two buttons held down at the same time. I noticed this immediately because as you know, I was testing my setup using a knock-off game pad until I fried it and I was trying a game and immediately I noticed that I can't get to move diagonally -- something that a USB game pad would allow.

I tried reprogramming the Teensy as a USB game pad and as I confirmed, it will now allow simultaneous key presses. See pics below.

I want to leave the Teensy programmed as a USB keyboard as diagonal movements is important for me, think arcade shoot-em up games. I wonder though if you have a specific reason why you chose to implement the Teensy as USB keyboard rather than a USB game pad. Perhaps I'm overlooking something.

This is my "chiz-built common ground dmg button" :lol: working as USB keyboard.

Image

And here it is once again, working as USB game pad. Notice that I'm holding two buttons at once and the joystick properties showing two buttons being held.

Image

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 1:54 am
by Fleder
Wow chiz, this is some sick soldering and tape work here!

Would you mind sharing what you've done, since i think everyone will be glad to use more than 1 button at the same time :)

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 1:56 am
by solder
Nice ghetto pcb :3 Good job!

I think the idea of it beeing keyboard is that it can be used as input in for example Openelec if you choose to dual or tripleboot.
But i agree that simultaneaus keypresses are a must in alot of games.

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 2:14 am
by chiz
@Fleder and @solder

That's my makeshift controller PCB until I get the GBZ controller PCB from Helder. I wanted to get a feel of the space and layout so I went one step further to Wermy's copper tape buttons :lol:

Anyways, regarding the USB game pad code... It's readily available and can be opened in the Arduino IDE under the menu, File -> Examples -> Teensy -> USB_Joystick -> Buttons

Once opened, flash the Teensy without any modifications and your game pad should be immediately detected under Windows.

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 2:48 am
by Robots86
I mentioned this on the last forum and think i will be going the joystick route. Its all about the gaming!

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 3:50 am
by crispy_tofu
That PCB is a work of art. Brings me to tears :cry:

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 1:05 pm
by wermy
That's really weird, mine definitely works with multiple button-presses at the same time (I just tried with Sonic Wings 3 and I was able to move diagonally and fire at the same time without issue).

I had done keyboard just to make it easier to configure some emulators. Plus I had planned on making it send arrow key presses, enter and escape, which would make it possible to do some things on the terminal (like scrolling through previous commands and executing them) but for whatever reason I couldn't get arrow keys to play nice.

Anyway, having said all that, USB joypad is of course fine too. :) I just wonder why yours is acting different than mine...

Edit: Also that hand-made PCB is awesome! :D

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 5:56 pm
by Popcorn
haha that's a piece of art!

Re: Teensy: Keyboard vs Joystick Decision

Posted: Fri May 06, 2016 6:09 pm
by prerunnerseth
I'm using the GPIO pins and the retro game c-code modified for my gpio pin choices. Works awesome and accepts more than one input at a time.

Re: Teensy: Keyboard vs Joystick Decision

Posted: Sat May 07, 2016 1:49 am
by Fleder
@chiz
Have you ditched the idea of using the SNES controllers boards?
You were my hope to get this straight, as I am a newbie at electronics.
Is it that the SNES Board requires too much space?