Troubleshooting Keyboard Issue with Shooter code
by William Urban · in Torque Game Builder · 04/16/2007 (9:09 pm) · 3 replies
Hello all,
So I ran into a pretty wonky issue today while playing around with the starting tutorials. At first I thought it was me not copying the code correctly but after much fun in troubleshooting it seems that there is something wonky going on.
Here is the scenario. I was doing the shooter tutorial but the shooter demo also exhibits the same code. So it's not just me writing the code wrong.
When flying the spaceship, if you hold down down and left or down and right and press space bar nothing gets fired. Up and left, up and right and you can fire a missile no problem, just when you hold down and left or down and right. I had another buddy try it on his computer and he couldn't replicate the problem. Through some thorough troubleshooting I've discovered it only happens with PS/2 keyboards and not USB keyboards.
Testbox 1, PS/2 keyboard, WinXP SP2 - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 2, PS/2 keyboard, Windows 2003 Server - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 3, USB keyboard, Windows 2003 Server - No issue. Can hold down and left or down and right and hit space to fire no problem.
Testbox 4, PS/2 keyboard, WinXP SP2 - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 4 again, PS/2 keyboard, Dual boot to Windows Vista - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 4 again, replaced with USB keyboard, Dual boot to Windows Vista - No issue!! Same box that had issue with PS/2! Can hold down and left or down and right and hit space to fire no problem.
Thats all the boxes I had to test with. Plus one remote friend computer with USB keyboard that worked no problem.
So... any ideas? Has anyone seen this or can they replicate it? I have 3 different PS/2 boxes that won't allow me to hold down and right or down and left and hit space to fire. If I thought it was an issue with too many buttons then I couldn't imagine why the up + left and up + right combos work *boggle*!
This one kind of stumped me. I'm glad to move on and stop poring over my code (my main coding box is the one with PS/2 keyboard) but I was wondering if this can be replicated or if there's any solution?
Thanks all!
-Will
So I ran into a pretty wonky issue today while playing around with the starting tutorials. At first I thought it was me not copying the code correctly but after much fun in troubleshooting it seems that there is something wonky going on.
Here is the scenario. I was doing the shooter tutorial but the shooter demo also exhibits the same code. So it's not just me writing the code wrong.
When flying the spaceship, if you hold down down and left or down and right and press space bar nothing gets fired. Up and left, up and right and you can fire a missile no problem, just when you hold down and left or down and right. I had another buddy try it on his computer and he couldn't replicate the problem. Through some thorough troubleshooting I've discovered it only happens with PS/2 keyboards and not USB keyboards.
Testbox 1, PS/2 keyboard, WinXP SP2 - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 2, PS/2 keyboard, Windows 2003 Server - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 3, USB keyboard, Windows 2003 Server - No issue. Can hold down and left or down and right and hit space to fire no problem.
Testbox 4, PS/2 keyboard, WinXP SP2 - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 4 again, PS/2 keyboard, Dual boot to Windows Vista - Same issue, cannot hold down and left or down and right plus hit space to fire. Up and left and up and right plus space to fire works.
Testbox 4 again, replaced with USB keyboard, Dual boot to Windows Vista - No issue!! Same box that had issue with PS/2! Can hold down and left or down and right and hit space to fire no problem.
Thats all the boxes I had to test with. Plus one remote friend computer with USB keyboard that worked no problem.
So... any ideas? Has anyone seen this or can they replicate it? I have 3 different PS/2 boxes that won't allow me to hold down and right or down and left and hit space to fire. If I thought it was an issue with too many buttons then I couldn't imagine why the up + left and up + right combos work *boggle*!
This one kind of stumped me. I'm glad to move on and stop poring over my code (my main coding box is the one with PS/2 keyboard) but I was wondering if this can be replicated or if there's any solution?
Thanks all!
-Will
#2
04/16/2007 (9:30 pm)
I thought that too but UP and LEFT plus Space fires the bullets, and UP and RIGHT plus Space fires the bullets. It's just Down and Left or Down and Right plus Space and no bullets come out. Oddest thing I've ever seen.
#3
-Will
04/16/2007 (9:48 pm)
Ok I ran one last test. Can't believe I didn't do this earlier. So the test I ran was to just remap they keys. So instead of WADS I used the arrow keys. Guess what? No issue on the PS/2 keyboard! Then I tried random keys along the keyboard and sometimes it would work, and sometimes it wouldn't. So I don't know anything about how keyboards are made or communicate but I'm guessing that ASD all use the same "register" or something so that when two of those keys are pressed, pressing space has no affect in game while if the keys were different and not on the same "register" or whatever, everything works out fine. Hope this helps anyone out there running into crazy mapping issues where multiple key presses aren't doing what you think they should.-Will
Torque Owner DragonSix