Conversation
|
Also added keybinding for adjusting scanning parameters stepwise. |
I haven't seen an issue filed on this. What is the issue? Is the use case that you want to adjust the sensitivity for keypress binds that adjust a slider or dial or similar control? Or does the encoder simply not register? If the unreliable behavior with knobs/encoders is fixed, would these keybinds become redundant? |
|
I ask because if we can make it so that any applicable keybind's rate and behavior are tuneable, we wouldn't have to implement stepwise logic ad hoc for each input. Could do it once instead of dozens of times and again for any new binds. |
|
I haven't filed an issue because I just got one of those macro keyboards the other day, And as my implementation is basically the same as your patches for impulse and jump controls (which was ironically introduced because the other bindings where too sensitive for key presses), which also work fine for that hardware.
Almost never. Maybe once or twice per 20-step revolution. My assumption is that the pulses are too short.
Of course it would be nice if we have less keybinds, but on the other hand we already started it with the helms and jump controls and I don't think there is much left. I think only 4 for the engineering slider, and theoretically 2 for ship rotation, but I think holding down a key feels much better than rotating a knob. |
|
For custom controls, doesn't it makes a lot more sense to use an "analogue" joystick axis? |
|
Well, the big advantage is that you can buy those keyboards off the shelf. For off-the-shelf analog controls you might be able to use throttles to move sliders, but those are usually much more expensive. Regular gaming joysticks have the obvious disadvantage of self-centering and feel also a bit awkward to use outside of helms and weapons. |
The impulse controls change was a hack introduced to workaround a regression introduced by SDL2. I'm not sure they're role models. An actual fix would replace those stepwise binds with sensitivity and rate-of-change settings for binds that involve sliders and dials, which would also fix them on keyboards (AimLock also moves way too fast for me on keypress) and tunable for different types of inputs (A2D pots, hats, gamepads, joysticks, etc.).
This is a bug that should be addressed by making sensitivity and rates of change configurable. Logging would confirm assumptions about whether the steps are registering. This would also fix the bug I'd expect to ensue from this implementation when someone uses a different encoder than yours or a potentiometer.
The point isn't fewer keybinds. It's:
If y'all want to do this for every control, that's fine. In the end it's just more code to remove, and more user-facing configurations that break, when the input system is improved.
There are already at least two PRs to fix helms rotation, and I wager both are mostly incompatible with encoders because they undo a stepwise implementation. Which goes back to needing to handle different types of inputs differently, even when we can't detect when a keyboard event is one rotary step, four rotary steps, an A2D pot value turned into a keypress event by a microcontroller, a joystick axis fed through Joy2Key, etc. |
|
Filed #2770 to get at the core issue that this is a symptom of. |
Jep, I mentioned just impulse control in #1739 because it was the first instance where I noticed the issue. It is basically present everywhere where getValue() is used instead of getDown(), i.e. bindings designed with joystick axes in mind. Fun fact: the impulse workaround actually works better for dial knobs then it works for keys, because you have to press the key for every single step.
Which is basically what I meant. However I am not entirely sure if that last part is feasible?
It currently looks very much like those PR won't be merged, so I don't think it will happen, and I stopped my work on the engineering part. But in my defense, I was not talking about every control, just a handful. And I am not at all imposed to an elegant solution that handles all kind of input properly. It just seemed that workarounds were the way to go on that matter, and more importantly, within my capabilities. |
It's feasible if sensitivity is user-configurable. If we can't rely on detection (if we can't rely on keypresses always coming from a keyboard, in this case) then we should offer the option for the user to define at least some aspects of how the event is handled. Especially those that are hardcoded, like the Likewise, sliders should have a similar behavior for stepped vs. sustained inputs, and that should be centralized in at least the GuiSlider implementation, if not higher. Then we get that benefit across every engineering, science, and helms slider, without having to tweak each one separately.
I'm not attacking you, and insofar as I'm attacking anything, it's the underlying problem with the input system. Similar to the cursor issue, the prior implementation has been good enough until it started to be used and extended past the limited scope it was originally designed to accomplish. What I'm anxious about is adding more workarounds that add user-facing config options and binds, which then get immediately removed or broken but linger in config files. That's an avoidable bad practice. Since this is happening between releases, things like this PR or the jump controls having a workaround aren't that big of a deal (everything on this branch is unstable), but IMO a broader input fix should be decided and acted on before there's an ECS release. A bigger cost of effort to fix it at the input and GuiElement levels, to also eliminate the need to piecemeal it inconsistently at the crew screen level. |
This adds keybindings for 15 degree steps for the manual weapon aiming. When the binding is used, the aim will snap to the next multiple of 15 rather than just adding 15°.
That way you can use rotary encoders or knobs on macro keyboards for aiming. As they only send a short signal each step, they do not work reliably with the weapons_aim_left/weapons_aim_right bindings.
Each step is a 1/24th of a full circle, which means you will hit both 8 cardinal and 12 "clock" directions. It is also pretty close to the 20 steps per rotation that many rotary encoders have, and you won't get a perfect positional match anyway.