Teensy: Keyboard vs Joystick Decision

Got an idea for a project? Found a cool project you want to share? Post it here!
User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 119 times

Teensy: Keyboard vs Joystick Decision

Post by chiz » Thu May 05, 2016 11:51 pm

@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
Last edited by chiz on Fri May 06, 2016 2:14 am, edited 1 time in total.

User avatar
Fleder
Posts: 849
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 183 times
Been thanked: 258 times

Re: Teensy: Keyboard vs Joystick Decision

Post by Fleder » Fri May 06, 2016 1:54 am

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 :)

User avatar
solder
Posts: 71
Joined: Thu May 05, 2016 3:27 am
Has thanked: 26 times
Been thanked: 14 times

Re: Teensy: Keyboard vs Joystick Decision

Post by solder » Fri May 06, 2016 1:56 am

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.

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 119 times

Re: Teensy: Keyboard vs Joystick Decision

Post by chiz » Fri May 06, 2016 2:14 am

@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.

User avatar
Robots86
Posts: 268
Joined: Thu May 05, 2016 1:18 am
Location: Birmingham, UK
Has thanked: 39 times
Been thanked: 28 times

Re: Teensy: Keyboard vs Joystick Decision

Post by Robots86 » Fri May 06, 2016 2:48 am

I mentioned this on the last forum and think i will be going the joystick route. Its all about the gaming!

User avatar
crispy_tofu
Posts: 340
Joined: Thu May 05, 2016 1:51 am
Location: Australia
Been thanked: 5 times

Re: Teensy: Keyboard vs Joystick Decision

Post by crispy_tofu » Fri May 06, 2016 3:50 am

That PCB is a work of art. Brings me to tears :cry:

User avatar
wermy
Site Admin
Posts: 1346
Joined: Tue May 03, 2016 8:51 pm
Has thanked: 620 times
Been thanked: 1322 times
Contact:

Re: Teensy: Keyboard vs Joystick Decision

Post by wermy » Fri May 06, 2016 1:05 pm

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
ImageImageImageImage

User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Teensy: Keyboard vs Joystick Decision

Post by Popcorn » Fri May 06, 2016 5:56 pm

haha that's a piece of art!

prerunnerseth
Posts: 279
Joined: Fri May 06, 2016 5:36 pm
Has thanked: 16 times
Been thanked: 229 times

Re: Teensy: Keyboard vs Joystick Decision

Post by prerunnerseth » Fri May 06, 2016 6:09 pm

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.

User avatar
Fleder
Posts: 849
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 183 times
Been thanked: 258 times

Re: Teensy: Keyboard vs Joystick Decision

Post by Fleder » Sat May 07, 2016 1:49 am

@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?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest