dterrahe / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
2 stars 0 forks source link

NG Input: Reserved keys #6

Closed elstoc closed 3 years ago

elstoc commented 3 years ago

It is possible to assign reserved keys to a keyboard shortcut.

For example, I can assign the arrow keys, but these are already assigned to many actions in the darkroom - panning zoomed images, altering sliders.

If I set the right arrow to a shortcut action and then press the key while hovering a slider, it performs the assigned shortcut action and modifies the slider.

Ref: darktable-org#8078

dterrahe commented 3 years ago

I guess I hadn't tried using arrow keys as "normal" shortcut, sorry.

The mechanisms by which the central widget responds to arrow keys is different from side-panel widgets. Some are hardcoded, whereas some are configurable (lighttable) but still separate from the normal accelerator/shortcut system. The latter are "supported" by this PR (it knows not to process those shortcuts) but the hardcoded ones are a bit more tricky and need workarounds until they are fully integrated in the framework (if ever). Some of the challenge of this PR is to figure out which workarounds are in place for the old system and either disable them (because they are not needed in the new system and instead cause problems) or replace them by new workarounds (maybe temporarily) or integrate them.

I'll analyse the issue and see which approach works best for arrow keys, for now. I'm kindof considering that left/right/up/down/pgup/pgdown need their own separate framework. And/or possibly work as a "move" for all shortcuts (i.e. up/down assignable in same way that "scroll" or "vertical mouse move" are)

A little thing to be aware of; in the preferences Shortcuts list (top half) the shortcuts that have a wriggly line under them are not handled by the NG shortcut system but fall through to the underlying handler (usually in the views). This includes all the (shift) arrow keys in lighttable. Those can only be assigned one (1) key+modifiers shortcut. They won't respond to midi or mouse.

elstoc commented 3 years ago

In a similar vein there is an issue with assigning ESC to a shortcut within the preferences window, in that you can't unassign it, because ESCdestroys the dialog after setting the shortcut. The only way to unassign it again is with the graphical point-and-click setup.

github-actions[bot] commented 3 years ago

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

dterrahe commented 3 years ago

The shortcuts that are handled by the views individually are still the odd-ones-out in the new framework. Once the framework is merged, that code can be more easily ported over as well, which would then allow external devices to also manipulate the center views. At the moment, those shortcuts only support one single key+modifiers. They are distinguished in the shortcuts dialog by a wiggly underline.

I believe that assigning arrow keys to other actions doesn't lead to double effects anymore. If a slider (or Entry) is active, it will grab the keypress and move the slider; any other assigned shortcut is ignored.

Escape can be assigned in the normal way while in mapping mode (after double clicking on an action in the shortcuts dialog for example). To exit mapping mode, right-click. Except when mapping a fallback (just "right click" is a valid fallback); in that case press any key (not a valid fallback) to exit mapping mode.

I will leave this open until all "reserved keys" are folded into the framework.

dterrahe commented 3 years ago

I believe this to have been resolved by #9672. Let me know (in the main repo) whenever you still encounter issues.