
Feature suggestion; Dual-purpose keys
jonqrandom opened this issue ยท 5 comments
full disclosure; this is a suggestion i made for a similar mod, but one that i think makes sense here too;
"what i mean is that your keys could act either as toggles (when tapped for less than a configurable number of milliseconds/ticks) or operate with vanilla behaviour if held for longer. that way a player could remap them to LCTRL and LSHIFT and easily access both behaviours without taking up two more (preciousssssss) keybinds ;)"
they seemed like they planned to implement it (gave it an "Enhancement" label and self-assigned it), but according to github they haven't touched the code since (nearly a year ago). just thought i should be upfront about that rather than engage in any pretense.
More concerned about the UI, there is literally no space for adding sliders or other buttons to configure the timings, so it'd need to be either rebuilt or hidden away in the config file. #42 wouldn't need any additional buttons.
Ultimately I think customizing keybinds by adding multiple modes would be extremely powerful, with your suggestion as one of the available modes. It would require a lot of changes to both the UI and how keybindings are handled (technically, hold
is the easiest, toggle
is a bit more involved, anything with timings and multiple behaviors would be the most complicated).
I can't say when I'll have time to do it, I'll probably get #42 working and released first, then look into a bigger overhaul later.
ah, i see, i'm sorry! and also sorry if i seemed pushy on account of being verbose; i'm honestly just being descriptive! if you never implement this, i totally respect your choice. i can't code myself so i've certainly no business trying to tell anyone else what to do ;)
I was thinking of adding different keybind modes (for ex. hold, press to toggle, maybe double tap to toggle, and what you suggested), I don't know how to make all the GUI configuration nice and intuitive without completely cluttering the screen, there'd probably also need to be an indicator in case the timing was very close. I like the idea, just struggling with how to implement it.
In terms of just reducing keybinds, the idea described in #42 would take up modifier keybinds, but would be possible to do something like Shift
sprint, Shift+G
toggle, Ctrl
sneak, Ctrl+G
toggle, which wouldn't need any special UI or timing.
i looked at #42 before i posted this, just to make sure i wasn't being (doubly?) redundant, and i'd certainly find it nicer to use than an extra pair of keybinds.
as far as timing goes, my thoughts were that the user would set it to something they were comfortable with - perhaps use either an intro "note" like Quark's, or a toast the first time the player sneaks or sprints, to let them know how to set up the timing?
i'll prefix this with the fact that i'm not a coder, so there's that, but; the way i'd envisage it working once the player's picked a timing would be like this;
on keyDown, the action starts as usual, and the mod starts a timer. if the relevant keyUp happens within however many ticks/milliseconds, then you toggle the action on until the next appropriate keyUp. if the timer expires, then the action stops on the first keyUp. so i suppose really you're just "eating" the first keyUp if it occurs soon enough?
Superseded by #45