Is there a way to make a key that has one action when pressed down and another when released like a button? Or a way to bind a button to a key?
Just wondering because if not I think that would be a pretty cool feature.
Press and Release Keys?
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Press and Release Keys?
You would have to redesign the (bool) TCommandLine::event(QEvent *) code to handle QEvent::KeyRelease events as well as QEvent::KeyPress ones and then revise some of the down stream methods to allow them to process such things. One thing to bear in mind is that once you have a KeyPress you must eventually get a KeyRelease (well in perhaps 99.9999% of cases) so this isn't something that immediately jumps out as a necessity - although I guess adding this sort of thing would allow for the equivalent to chorded input with just a few keyboard (gamepad/game-mouse?) keys/buttons.
Re: Press and Release Keys?
So what we're saying is that you can't right now, but it would be possible to add such a feature
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Press and Release Keys?
Yes - and maybe...
How many keys being down that can be handled does, if I recall correctly depend on the keyboard hardware - and how many key-rollovers it supports: see Wikipedia article on Rollover (key) section n-key_rollover
How many keys being down that can be handled does, if I recall correctly depend on the keyboard hardware - and how many key-rollovers it supports: see Wikipedia article on Rollover (key) section n-key_rollover