Teensy key wasd configuration - why?
- statikeffeck
- Posts: 31
- Joined: Tue Jul 05, 2016 8:35 pm
- Has thanked: 23 times
- Been thanked: 5 times
Teensy key wasd configuration - why?
I was wondering why map the gameboy controller in keyboard layout to letter keys like wasd q z and so on and not use arrow keys, enter key, etc. I found that I cannot navigate the "Dos" style menus without plugging in a keyboard and I have to be careful about which menu I choose.
I bet if I rewired my teensy to keyboard arrows and at least one enter key I could navigate most of the menus with just the control pad. Has anyone done this or does it break more things than it's worth?
I bet if I rewired my teensy to keyboard arrows and at least one enter key I could navigate most of the menus with just the control pad. Has anyone done this or does it break more things than it's worth?
- Fleder
- Posts: 849
- Joined: Thu May 05, 2016 9:04 am
- Location: Germany
- Has thanked: 183 times
- Been thanked: 258 times
Re: Teensy key wasd configuration - why?
There is nothing to break as it is only a matter of programming the teensy.
If you are not satisfied, just use the original programing again.
You can choose the keys you want.
But if you really want to have a complete keyboard, how about something like this: Measy RC11
Only plug it in if you have to type a lot of stuff.
I use it at my Media Center (Kodi) and it works like a charm. Plus you've got a nice Wii Mote style Mouse, too.
It is also available from the EU warehouse for just a bit more.
It is also available on Amazon with Prime here: https://www.amazon.de/-1-Funktion-Handh ... measy+rc11
Or on DX here: http://eud.dx.com/product/measy-rc11-2- ... -844144871
If you are not satisfied, just use the original programing again.
You can choose the keys you want.
But if you really want to have a complete keyboard, how about something like this: Measy RC11
Only plug it in if you have to type a lot of stuff.
I use it at my Media Center (Kodi) and it works like a charm. Plus you've got a nice Wii Mote style Mouse, too.
It is also available from the EU warehouse for just a bit more.
It is also available on Amazon with Prime here: https://www.amazon.de/-1-Funktion-Handh ... measy+rc11
Or on DX here: http://eud.dx.com/product/measy-rc11-2- ... -844144871
- skrapps914
- Posts: 184
- Joined: Sat May 28, 2016 8:14 pm
- Has thanked: 63 times
- Been thanked: 33 times
Re: Teensy key wasd configuration - why?
this has me intrigued. what is the original programming?Fleder wrote:There is nothing to break as it is only a matter of programming the teensy.
If you are not satisfied, just use the original programing again.
You can choose the keys you want.
and how do you use it?
i agree with op, i think arrow keys would work better
somehow i managed to code my teensy, making the d-pad hat switches, so i can navigate dos, but now mame wont recognize the hat switches
its all screwy lol
- Fleder
- Posts: 849
- Joined: Thu May 05, 2016 9:04 am
- Location: Germany
- Has thanked: 183 times
- Been thanked: 258 times
Re: Teensy key wasd configuration - why?
The one you used first?skrapps914 wrote:this has me intrigued. what is the original programming?
and how do you use it?
Either the sketch from wermy or any other sketch you used to program your teensy.
And you use it the same way you did before.
- skrapps914
- Posts: 184
- Joined: Sat May 28, 2016 8:14 pm
- Has thanked: 63 times
- Been thanked: 33 times
Re: Teensy key wasd configuration - why?
the sketch from wermy used wasd i believe, and if i used things like the scraper, whenever i would input one of those letters, it would also move the cursor. it was hard to use.The one you used first?
Either the sketch from wermy or any other sketch you used to program your teensy.
And you use it the same way you did before.
i'd like to replace the wsad with arrow keys in the sketch, but dont know how to
- Fleder
- Posts: 849
- Joined: Thu May 05, 2016 9:04 am
- Location: Germany
- Has thanked: 183 times
- Been thanked: 258 times
Re: Teensy key wasd configuration - why?
Just replace KEY_W KEY_A KEY_S KEY_Dskrapps914 wrote:the sketch from wermy used wasd i believe, and if i used things like the scraper, whenever i would input one of those letters, it would also move the cursor. it was hard to use.
i'd like to replace the wsad with arrow keys in the sketch, but dont know how to
with KEY_UP KEY_LEFT KEY_DOWN KEY_RIGHT
in the sketch and you should be good to go.
Edit: Wermy did use a different method,
i can't test it right now but you should just replace the respective part of the sketch with this:
Code: Select all
void setupKeys() {
keys[0] = key('UP', 0);
keys[1] = key('DOWN', 1);
keys[2] = key('LEFT', 2);
keys[3] = key('RIGHT', 3);
keys[4] = key('p', 4);
keys[5] = key('l', 5);
keys[6] = key('o', 6);
keys[7] = key('k', 7);
keys[8] = key('x', 8);
keys[9] = key('z', 9);
keys[10] = key('q',10);
keys[11] = key('e',11);
}
If this does not work, try this one:
Code: Select all
void setupKeys() {
keys[0] = key('KEY_UP', 0);
keys[1] = key('KEY_DOWN', 1);
keys[2] = key('KEY_LEFT', 2);
keys[3] = key('KEY_RIGHT', 3);
keys[4] = key('p', 4);
keys[5] = key('l', 5);
keys[6] = key('o', 6);
keys[7] = key('k', 7);
keys[8] = key('x', 8);
keys[9] = key('z', 9);
keys[10] = key('q',10);
keys[11] = key('e',11);
}
- skrapps914
- Posts: 184
- Joined: Sat May 28, 2016 8:14 pm
- Has thanked: 63 times
- Been thanked: 33 times
Re: Teensy key wasd configuration - why?
Thanks a ton!! Going to try it first thing in the morning, when i wake upFleder wrote:Just replace KEY_W KEY_A KEY_S KEY_Dskrapps914 wrote:the sketch from wermy used wasd i believe, and if i used things like the scraper, whenever i would input one of those letters, it would also move the cursor. it was hard to use.
i'd like to replace the wsad with arrow keys in the sketch, but dont know how to
with KEY_UP KEY_LEFT KEY_DOWN KEY_RIGHT
in the sketch and you should be good to go.
Edit: Wermy did use a different method,
i can't test it right now but you should just replace the respective part of the sketch with this:Again, i can't test it, you have to try it yourself.Code: Select all
void setupKeys() { keys[0] = key('UP', 0); keys[1] = key('DOWN', 1); keys[2] = key('LEFT', 2); keys[3] = key('RIGHT', 3); keys[4] = key('p', 4); keys[5] = key('l', 5); keys[6] = key('o', 6); keys[7] = key('k', 7); keys[8] = key('x', 8); keys[9] = key('z', 9); keys[10] = key('q',10); keys[11] = key('e',11); }
If this does not work, try this one:Code: Select all
void setupKeys() { keys[0] = key('KEY_UP', 0); keys[1] = key('KEY_DOWN', 1); keys[2] = key('KEY_LEFT', 2); keys[3] = key('KEY_RIGHT', 3); keys[4] = key('p', 4); keys[5] = key('l', 5); keys[6] = key('o', 6); keys[7] = key('k', 7); keys[8] = key('x', 8); keys[9] = key('z', 9); keys[10] = key('q',10); keys[11] = key('e',11); }
- skrapps914
- Posts: 184
- Joined: Sat May 28, 2016 8:14 pm
- Has thanked: 63 times
- Been thanked: 33 times
Re: Teensy key wasd configuration - why?
@fleder
none of them would work, an i get an error message, and in emulation station its recognizing just the last letter of each key name.. so UP. became key P, DOWN became key N and so on.
Arduino: 1.6.8 (Windows 10), TD: 1.28, Board: "Teensy LC, Keyboard + Mouse + Joystick, 48 MHz, US English"
warning: character constant too long for its type [enabled by default]
keys[0] = key('KEY_UP', 0);
^
warning: character constant too long for its type [enabled by default]
keys[1] = key('KEY_DOWN', 1);
^
warning: character constant too long for its type [enabled by default]
keys[2] = key('KEY_LEFT', 2);
^
warning: character constant too long for its type [enabled by default]
keys[3] = key('KEY_RIGHT', 3);
^
gbzudlr2:1: error: 'dovoid' does not name a type
dovoid setupKeys() {
^
gbzudlr2:1: error: 'dovoid' does not name a type
dovoid setupKeys() {
^
'dovoid' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
none of them would work, an i get an error message, and in emulation station its recognizing just the last letter of each key name.. so UP. became key P, DOWN became key N and so on.
Arduino: 1.6.8 (Windows 10), TD: 1.28, Board: "Teensy LC, Keyboard + Mouse + Joystick, 48 MHz, US English"
warning: character constant too long for its type [enabled by default]
keys[0] = key('KEY_UP', 0);
^
warning: character constant too long for its type [enabled by default]
keys[1] = key('KEY_DOWN', 1);
^
warning: character constant too long for its type [enabled by default]
keys[2] = key('KEY_LEFT', 2);
^
warning: character constant too long for its type [enabled by default]
keys[3] = key('KEY_RIGHT', 3);
^
gbzudlr2:1: error: 'dovoid' does not name a type
dovoid setupKeys() {
^
gbzudlr2:1: error: 'dovoid' does not name a type
dovoid setupKeys() {
^
'dovoid' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
- Fleder
- Posts: 849
- Joined: Thu May 05, 2016 9:04 am
- Location: Germany
- Has thanked: 183 times
- Been thanked: 258 times
Re: Teensy key wasd configuration - why?
The first one did not work, either?skrapps914 wrote:@fleder
none of them would work, an i get an error message, and in emulation station its recognizing just the last letter of each key name.. so UP. became key P, DOWN became key N and so on.
Hmmm, it seems that arrow keys are a problem because of the serial interface,
as you can not "type" an arrow key. At least that is what other users reported.
You can try to use either KEY_UP_ARROW, KEY_DOWN_ARROW and so on
or their corresponding HEX or Decimal values. But i don't know if this will work.
You will have to try, as is often the case.
Code: Select all
Key Hex Decimal
KEY_UP_ARROW 0xDA 218
KEY_DOWN_ARROW 0xD9 217
KEY_LEFT_ARROW 0xD8 216
KEY_RIGHT_ARROW 0xD7 215
Who is online
Users browsing this forum: No registered users and 1 guest