diff --git a/client/src/index.ts b/client/src/index.ts
index 2d011179..347bab58 100644
--- a/client/src/index.ts
+++ b/client/src/index.ts
@@ -187,10 +187,12 @@ function setupEvents( indexApp:OlympusApp ) {
[ "KeyW", "KeyA", "KeyS", "KeyD", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown" ].forEach( code => {
shortcutManager.add( `pan${code}keydown`, new ShortcutKeyboard({
+ "altKey": false,
"callback": ( ev:KeyboardEvent ) => {
getMap().handleMapPanning(ev);
},
"code": code,
+ "ctrlKey": false,
"event": "keydown"
}));
});
diff --git a/client/src/plugins/helloworld/pluginhelloworld.ts b/client/src/plugins/helloworld/pluginhelloworld.ts
index b024cd16..f01cbb9f 100644
--- a/client/src/plugins/helloworld/pluginhelloworld.ts
+++ b/client/src/plugins/helloworld/pluginhelloworld.ts
@@ -1,10 +1,13 @@
-import { IndexApp } from "../../indexapp";
import { OlympusApp } from "../../olympusapp";
import { Plugin } from "../../plugin/plugin";
+import { ShortcutManager } from "../../shortcut/shortcutmanager";
export class PluginHelloWorld extends Plugin {
+ #element:HTMLElement;
+ #shortcutManager:ShortcutManager;
+
constructor( olympusApp:OlympusApp ) {
super( olympusApp, "HelloWorld" );
@@ -13,18 +16,74 @@ export class PluginHelloWorld extends Plugin {
bar: `
CTRL: Pin tool | SHIFT: box select tool
`
+ z-index:999;">`
}
document.body.insertAdjacentHTML( "beforeend", templates.bar );
+ this.#element = document.getElementById( "shortcut-bar" );
+
+ this.#shortcutManager = this.getOlympusApp().getShortcutManager();
+
+ this.#shortcutManager.onKeyDown( () => {
+ this.#updateText()
+ });
+
+ this.#shortcutManager.onKeyUp( () => {
+ this.#updateText()
+ });
+
+ this.#updateText();
+
}
+
+ #matches( combo:string[], heldKeys:string[] ) {
+
+ if ( combo.length !== heldKeys.length ) {
+ return false;
+ }
+
+ return combo.every( key => heldKeys.indexOf( key ) > -1 );
+
+ }
+
+ #updateText() {
+
+ const heldKeys = this.#shortcutManager.getKeysBeingHeld();
+
+ const combos:Array