- Home /
Input key codes for Logitech Extreme 3D Pro
I'm trying to use a Logitech Extreme 3D Pro joystick with Unity and I can get all of the buttons except the "Hat" on the top of the joystick which I want to use for POV. I may have messed up in testing, but it didn't seem to correlate to either a joystick button or a joystick axis.
Does anyone happen to know what the correct key code are to use with the hat on this joystick?
Answer by Eric5h5 · Jul 29, 2010 at 04:12 AM
The hat is the 5th and 6th joystick axes, for left/right and up/down respectively.
Hmmm... no response to the 5th and 6th axis. Starting to think I might have some other issue going on. Thank you very much for the input.
@spiel2001: I have that joystick; it definitely works here.
I figured it out -- it was a stupid programmer trick on my part... I was allowing the use of either a mouse-look via left-click and drag or via the POV hat... well... if you're using the hat, you're not left-clicking the mouse are you. /doh
Once I realized that, I got the input from the hat. However, for the record, it came in on 4th and 5th axis for me.
Again... thank you.
@spiel2001, hmm, the 4th axis should be the throttle, at least going by the axis numbering in the input manager, which starts at 1 rather than 0.
hi @spiel2001 may I know what is your input for x/y axis for the stick. $$anonymous$$y program cannot detect any movement from the stick but all the other button and hat can be detected.
Hope you can help.
Answer by qJake · Jul 29, 2010 at 03:01 AM
First, check to make sure it even shows up in the Windows Gamepad configuration screen (Gamepad settings in the control panel). Press the button with that screen open and see if any inputs light up. If not, this button is not a "normal" joystick button and can't be used (The Xbox button on the 360 controller is a good example of a "special" button). If it does light up, chances are you're just missing it in Unity's configuration. You can use a script like this to find out what button number it is:
// Stick this in Update() // C#
for(int i = 0; i < 20; i++) { if(Input.GetKeyDown("joystick button " + i)) { Debug.Log("Button " + i + " was pressed!"); } }
The hat isn't a button, so I'm afraid that won't do anything.
Oh...well he said "I got all the buttons except the hat", so, ya know, I just went off that, but you obviously know what joystick he's talking about. :P
Yeah... it definitely does not show up as a button, but thank you for the input.