mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 09:04:02 +02:00
enable keybindings for unavailable operations -> show info message
this should make it easier to discover what a given keypress was supposed to do (e.g. which operation it triggered) closes #9896
This commit is contained in:
@@ -12,7 +12,6 @@ export function utilKeybinding(namespace) {
|
||||
function testBindings(d3_event, isCapturing) {
|
||||
var didMatch = false;
|
||||
var bindings = Object.keys(_keybindings).map(function(id) { return _keybindings[id]; });
|
||||
var i, binding;
|
||||
|
||||
// Most key shortcuts will accept either lower or uppercase ('h' or 'H'),
|
||||
// so we don't strictly match on the shift key, but we prioritize
|
||||
@@ -20,8 +19,7 @@ export function utilKeybinding(namespace) {
|
||||
// (This lets us differentiate between '←'/'⇧←' or '⌘Z'/'⌘⇧Z')
|
||||
|
||||
// priority match shifted keybindings first
|
||||
for (i = 0; i < bindings.length; i++) {
|
||||
binding = bindings[i];
|
||||
for (const binding of bindings) {
|
||||
if (!binding.event.modifiers.shiftKey) continue; // no shift
|
||||
if (!!binding.capture !== isCapturing) continue;
|
||||
if (matches(d3_event, binding, true)) {
|
||||
@@ -36,8 +34,7 @@ export function utilKeybinding(namespace) {
|
||||
if (didMatch) return;
|
||||
|
||||
// then unshifted keybindings
|
||||
for (i = 0; i < bindings.length; i++) {
|
||||
binding = bindings[i];
|
||||
for (const binding of bindings) {
|
||||
if (binding.event.modifiers.shiftKey) continue; // shift
|
||||
if (!!binding.capture !== isCapturing) continue;
|
||||
if (matches(d3_event, binding, false)) {
|
||||
|
||||
Reference in New Issue
Block a user