make duplicate registerItem() a no-op

This commit is contained in:
2022-10-06 20:12:18 +00:00
parent bf51c8c0e8
commit 50cbf2f36f
2 changed files with 4 additions and 1 deletions

View File

@@ -221,7 +221,6 @@
(controls.clear) (controls.clear)
(inputTexts.clear) (inputTexts.clear)
(keyHandler.clear) (keyHandler.clear)
(xHandler.clear)
(makeXControls) (makeXControls)
(set nextControlX 0) (set nextControlX 0)
(set nextControlY 0) (set nextControlY 0)

View File

@@ -80,6 +80,10 @@
conflictMessage "Keyboard shortcut for $description conflicts with $existingKey"] conflictMessage "Keyboard shortcut for $description conflicts with $existingKey"]
(if keys (if keys
(case existingKey (case existingKey
// No harm in registering the same item twice:
((when (= otherItem item) (or (Final otherItem) (Cancel otherItem)))
(return))
// Conflicting with a different one, on the other hand:
((or (Final _) (Cancel _)) ((or (Final _) (Cancel _))
(tryCallOrThrow onBadShortcut conflictMessage false description existingKey)) (tryCallOrThrow onBadShortcut conflictMessage false description existingKey))
((Prefix innerPrefixMap) ((Prefix innerPrefixMap)