ArchiveUI showPrefixMap and hidePrefixMap

This commit is contained in:
2022-07-05 15:21:15 +00:00
parent 36d17b9cef
commit df334fc7a6
3 changed files with 17 additions and 6 deletions

View File

@@ -16,6 +16,9 @@ interface ArchiveUI {
*/
var shortcutHandler(default, null):Null<KeyShortcutHandler<Entry>>;
function showPrefixMap(map:Map<String,ShortcutKey<Entry>>):Void;
function hidePrefixMap():Void;
/**
* A PlaygroundSystem that will display interactible entry representations
*/

View File

@@ -11,7 +11,12 @@
{
(when (and ui ui.shortcutHandler)
(unless setup
(set ui.shortcutHandler.onSelectItem (invokeEntry.bind archive ui))
(set ui.shortcutHandler.onSelectPrefixMap ui.showPrefixMap)
(set ui.shortcutHandler.onSelectItem
->e {
(ui.hidePrefixMap)
(invokeEntry archive ui e)
})
(set ui.shortcutHandler.onBadKey ->[key map] (ui.displayMessage "$key is not mapped to a shortcut in this context: $map"))
(set setup true))