![]() |
Joystick and keyboard output question (PC)
I am trying to write a code for converting joystick outputs to keyboard controls, but I can't seam to find where I can call the outputs from. If someone can show me where to find these variables. I also need to know the same things for keyboard outputs (in specific the arrow keys).
Thanks, Alex Dinsmoor FRC 201 |
Re: Joystick and keyboard output question (PC)
I.. think this is what you are asking.
http://www.ifirobotics.com/docs/lega...e-2004-1-7.pdf Look at the different tables they have on the ports. The variables are named like "p1_sw_trig" (see the Variable Name column) This doesn't cover keyboard input or anything. Could you elaborate more on what you are looking for? |
Re: Joystick and keyboard output question (PC)
If you are looking for keyboard output (keyboard meaning a computer keyboard, not a robot one?), I think what you're looking for are scan codes (wiki article), which is what the keyboard sends as a number when a key is pressed. Are you trying to use a keyboard to control a robot instead of a joystick?
Here is a very simple routine I did once to test C (not C++) keyboard output: Code:
void stream (void) //type out infoCome to think of it, these might not be true "scan codes", but are actually semi-processed numbers. True scan codes I think send the actual keyboard key and you have to figure out what key that represents (depending on hardware), and then mix in the shift/ctrl/alt key(s) separately. (Making a Dvorak keyboard from a QWERTY, for example, back in DOS days.) That's more assembler than C code, so don't worry about it. What whitetiger0990 has are the codes the robot controller gives you for joystick output. Normally joysticks and keyboards don't mix, so I too am curious on what you may be trying to do. ____________________________ "If it weren't for electricity we'd all be watching television by candlelight." - George Gobel |
Re: Joystick and keyboard output question (PC)
Yup that's what I was looking for. I'm trying to make it so when I go forward on the joystick it will automatically press the arrow key that corresponds with the direction. I'm toying with this for online games and such that use the arrow keys.
|
Re: Joystick and keyboard output question (PC)
Does JoyToKey do what you want?
|
Re: Joystick and keyboard output question (PC)
Quote:
|
| All times are GMT -5. The time now is 00:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi