openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.37k stars 1.21k forks source link

Allow mouse rebindings, to e.g., match JOSM #7866

Open jidanni opened 4 years ago

jidanni commented 4 years ago

There is no way to make JOSM mouse bindings match iD, https://josm.openstreetmap.de/ticket/18186 https://josm.openstreetmap.de/ticket/4760 So I hope iD doesn't make the same mistake hardwiring them so deep down that there is no way a former JOSM user could rebind them to match what he is used to.

quincylvania commented 4 years ago

I've been thinking it might be a nice accessibility feature to let people re-map the keyboard shortcuts. I'm not sure about the mouse buttons though, that might be too advanced. It'd take some work to implement but probably isn't impossible.

jidanni commented 4 years ago

Yes these should use proper https://en.wikipedia.org/wiki/Abstraction_layer and avoid https://en.wikipedia.org/wiki/Hard_coding left/right handedness.

1ec5 commented 4 years ago

At a glance, avoiding a handedness bias sounds beneficial. I think the current English accelerator keys were optimized for the left hand (assuming the right hand is for the mouse) on an English keyboard.

Just to set expectations, even though it seems feasible to make the key bindings customizable, JOSM key bindings might not be 100% faithful to JOSM. For example, on the Mac, Ctrl-clicking opens the context menu, and I’m not sure if there’s a way to prevent that from happening in a Web application in order to allow for Ctrl-dragging on that platform. On top of that, few Web applications override shortcuts like CtrlT and CtrlW (⌘T and ⌘W on the Mac). I’d imagine even JOSM fans would expect those shortcuts to open and close tabs rather than focus a tag editor or toggle wireframe mode, respectively.

iD already allows localizations to map the accelerator keys (the shortcuts without modifier keys) to operations that match mnemonics in the current language. This is good for learnability, for the same reason that S for straighten and W for wireframe is good for learnability in English. As far as I know, JOSM doesn’t tie key bindings to languages, so I guess any JOSM key binding feature would be mutually exclusive with the localized accelerator keys.

jidanni commented 4 years ago

(All I know is I grew up with Emacs in the 1980s. With all its layers of keyboard maps I don't think there would be a way to hardwire a binding even if one tried. (They had already fixed this problem of programs from the 70s.))

jidanni commented 4 years ago

(Anyway these million dollar airplanes shouldn't be made unflyable due to the lack of a simple right/left mode switch.)

1ec5 commented 4 years ago

What if the airplane is flying inside a wind tunnel that has its own rules? :wink:

jidanni commented 4 years ago

(I'm thinking of those one-seater over expensive military models, with all controls, say, having right/left physical symmetry, but alas with the symmetry "permanently stuck one way" via software.)