Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for binding joystick buttons to keyboard shortcuts #118

Closed
Len62 opened this issue Jan 11, 2015 · 34 comments
Closed

Allow for binding joystick buttons to keyboard shortcuts #118

Len62 opened this issue Jan 11, 2015 · 34 comments

Comments

@Len62
Copy link

Len62 commented Jan 11, 2015

First, I love opentrack and use it exclusively. Is there a way that the "key" options can be set to include the alphanumeric keys as it was in 2.2?

@sthalik
Copy link
Member

sthalik commented Feb 1, 2015

The key list is too long that way. Is this really an issue?

@Len62
Copy link
Author

Len62 commented Feb 2, 2015

Not really an issue, just was used to the older version. Thank you for your response.

@Len62 Len62 closed this as completed Feb 2, 2015
@DerangedPineapple
Copy link

Would it be possible to open this issue (so theres no need to create a new one)?

It would be beneficial to add a feature where user could designate what ever key he/she wants for Center/Toggle/Zero functions.

Case example
When in Arma 3 many times when using optics or when zooming in while flying helicopter it would be nice to actually bind a same key to center/toggle that you use for optics or zoom in in arma 3 so your view especially when zoomed in wouldn't sway all over the place so easily.

Work around I currently use is to use autohotkey and rebind ie. F11 to actually send Return key press but thats kinda stupid in my opinion when it could be integrated into Opentrack in the first place. It would work much more reliably too in that way.

@sthalik sthalik reopened this Jun 10, 2015
@sthalik
Copy link
Member

sthalik commented Jun 10, 2015

@DerangedPineapple it's not a perfect solution as it can get out of sync. It can switch to fast profile when you're starting optics, and smooth profile when exiting optics mode. For instance try pressing escape and pressing the key then.

As for this request and #162 give some time for new Accela binary build gets published. I don't get jumps in optics mode anymore with pure "rotation sensitivity" filtering, without even smoothing or deadzone. I have a solid feeling the flter can be improved enough not to cause problems anymore.

@DerangedPineapple
Copy link

Thanks for reopening this man! Love your work.

I don't understand about switching between fast and smooth profile nor pressing escape etc. Is this somehow connected to binding whatever key/button to center/toggle/zero features?

I merely wanted to support the idea what OP started which was that it would be nice feature to bind whatever key/mouse button to Centre/Toggle/Delay functionalities. That way I could bind whatever button I need for toggle and/or center functionalities so every time when I use optics mode in arma 3 (or zoom in while flying) my tracker would either center headtracking or even toggle it.

You have all the time in the world, no hurry from my side. Opentrack works like a charm allready, these are just nice to have features to make things a bit more flexible and accessible.

@sthalik
Copy link
Member

sthalik commented Jun 10, 2015

Actually binding any button makes sense. Software usually allows for it with no button list like ours.

It's a bit of work because of how poorly the keyboard shortcut code is structured. I'd like to get back to it sometime though.

@sthalik sthalik changed the title Center/Toggle/Zero keys Allow for binding any key to keyboard shortcuts Jun 10, 2015
@DerangedPineapple
Copy link

Glad to hear that it would be possible to implement it at some point.

@phizz166
Copy link

+1 to this. Obviously sim-type games/programs are the most likely to use nearly every key on your keyboard...between ArmA and DCS I use pretty much all of the keys that are made available in OpenTrack, even with modifiers. Being able to set this to any key would be best.

Incidentally, attaching a joystick button to center the view would be even better.

@sthalik
Copy link
Member

sthalik commented Jul 19, 2015

I agree. We'll also do joystick buttons.

@Len62
Copy link
Author

Len62 commented Jul 19, 2015

Perfect! Thank you, will be looking forward to this!

sthalik added a commit that referenced this issue Jul 25, 2015
Issue: #118

Linux and OSX likely broken for now.
sthalik added a commit that referenced this issue Jul 25, 2015
Issue: #118

Linux and OSX likely broken for now.
@sthalik
Copy link
Member

sthalik commented Jul 25, 2015

Works on all platforms except Windows joystick buttons.

@sthalik
Copy link
Member

sthalik commented Aug 6, 2015

How many people want Linux joystick buttons?

@sthalik sthalik changed the title Allow for binding any key to keyboard shortcuts Allow for binding any key or joystick button to keyboard shortcuts Aug 22, 2015
@sthalik sthalik changed the title Allow for binding any key or joystick button to keyboard shortcuts Allow for binding any joystick button to keyboard shortcuts Oct 6, 2015
@sthalik sthalik added the ready label Oct 10, 2015
@sthalik sthalik changed the title Allow for binding any joystick button to keyboard shortcuts Allow for binding joystick buttons to keyboard shortcuts Oct 10, 2015
sthalik added a commit that referenced this issue Nov 11, 2015
@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

I don't like the way it's implemented but it has to wait. Hell froze over. Build - https://db.tt/vtxgIy9Z

@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

@Len62 @DerangedPineapple please give it a try since I only did light testing. Thanks.

@Len62
Copy link
Author

Len62 commented Nov 11, 2015

Gave it a try, 1st, when you select bind, and press a button on the joystick you have to hold the button down until the window auto closes, shouldn't it just register it on click/release? (Like the keyboard inputs) 2nd, when you hit ok to close the option window the joystick assignments do not hold, they all change to button "15". 3rd, unlike in the joystick tracker, were it identifies the 3 controls I have, joystick, throttle, and rudder pedals, there is no option in the shortcut bindings to select the device you want to use.

@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

It detects a stick only after a 2-second delay since startup due to a bug.

Is it that button 15 is always pressed on your device, like a mode switch or something?

You SHOULD be able to select the device, merely the tooltip won't show that information.

sthalik added a commit that referenced this issue Nov 11, 2015
Some buttons like the X65 mode switch are held all the time. Prevent
them from hogging all the keybindings.

Issue: #118
@Len62
Copy link
Author

Len62 commented Nov 11, 2015

Button 15 is just a toggle on the throttle controller and only active when pressed. I noticed that none of the buttons on the throttle are recognized if I try and set a short-cut. Buttons on the joystick are sometimes recognized and revert to 15 after clicking OK.

@Len62
Copy link
Author

Len62 commented Nov 11, 2015

If it helps any my rudder pedals are ID'd as joystick 0, joystick itself is joystick 1, and throttle is joystick 2. These are the controller id's assigned by windows. They do show up correctly identified in the joystick tracker though. There is a mode switch on the throttle. Ok, will check the new one.

@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

Recheck the current one - https://db.tt/oLrcqfz7

I'll hook you up with a debug build if it's still porked.

@Len62
Copy link
Author

Len62 commented Nov 11, 2015

Okay! I was able to correctly assign shortcuts on both the throttle and the joystick, and the settings are being retained. Center, zero, and toggle all working. I did notice that the zero and toggle only work while the button is being held down, not sure it that is by design or not. Using keyboard shortcuts is like having off/on switch.

sthalik added a commit that referenced this issue Nov 11, 2015
@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

It's meant to be the same toggle, bug fixed - https://db.tt/FDlMX9CD

Does it work for all of your USB devices?

@Len62
Copy link
Author

Len62 commented Nov 11, 2015

One last thing. Could the ctrl, alt, shft modifiers be set to work in conjunction with the joystick inputs? Thank you for all of your work on getting this implemented! I always recommend opentrack to anyone looking into head tracking options! Just saw the new build, will test it.

@Len62
Copy link
Author

Len62 commented Nov 11, 2015

Tested the new build. Input from both the throttle and joystick are working perfectly! Only other USB device I have are the rudder pedals.

@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

Keyboard modifiers should work now - https://db.tt/W27DR8k1

@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

To be clear - we don't use joystick indices in Windows to distinguish them. We use unique joystick identifiers. It should even work when switching USB ports, at least in theory.

@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

@Len62 can we get this checked and next rc out of the door today? Thanks!

@Len62
Copy link
Author

Len62 commented Nov 11, 2015

Tested the new build and everything is working great! Using the joy identifiers is the way to go otherwise windows can muck-up usb assignments.

@sthalik
Copy link
Member

sthalik commented Nov 11, 2015

I agree. They just won't show in the UI since these identifiers are pretty long. I don't want to resize the shortcut dialog for for their sake.

@Len62
Copy link
Author

Len62 commented Nov 11, 2015

It's fine as it is. And you are right, some of those identifiers are way too long. Thanks again!

sthalik added a commit that referenced this issue Nov 12, 2015
My X65 emits modeswitch events only a while after getting plugged in.

This only affects newly hotplugged joysticks. Ones plugged in before
listening start start processing events immediately.

Issue: #118
@sthalik
Copy link
Member

sthalik commented Nov 16, 2015

We're good, and will reopen if more bugs.

@sthalik sthalik closed this as completed Nov 16, 2015
@sthalik sthalik removed the todo label Nov 16, 2015
@Boberro
Copy link

Boberro commented Mar 27, 2016

Hi, I'm using windows version of 2.3-rc21p11 and it's impossible to bind mouse buttons for hotkeys (nothing happens when I click). Joystick seems to be not working too, but I have Steam Controller so it's strange by itself.

@Len62
Copy link
Author

Len62 commented Mar 27, 2016

I don't think the hotkeys can be bound to the mouse. Joystick bindings work fine. Are you running opentrack w/admin privileges? What joystick are you using? I'm not familiar with the Steam Controller, maybe someone else will comment.

@Boberro
Copy link

Boberro commented Mar 28, 2016

Lack of possibility to bind mouse buttons for hotkeys is a shame, as today standard mouse has 5 buttons (thumb "back" and "forward" seem to be standard now (and I definitely use them for tracking toggle and center with FacetrackNoIR)

@sthalik
Copy link
Member

sthalik commented Mar 28, 2016

Mouse bindings are a separate method of input that would have to be implemented. Code is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants