From 95c387ef51edf276691b4f057f9168dc362fbc22 Mon Sep 17 00:00:00 2001 From: candle Date: Mon, 5 Aug 2024 18:16:58 +0100 Subject: [PATCH] hotkey to flip colors --- src/scripts/editor/editor.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scripts/editor/editor.js b/src/scripts/editor/editor.js index f61c606..bdc385d 100644 --- a/src/scripts/editor/editor.js +++ b/src/scripts/editor/editor.js @@ -1472,6 +1472,16 @@ class BipsiEditor extends EventTarget { event.preventDefault(); } }); + + if (event.key.toLocaleLowerCase()) { + event.preventDefault(); + + const prevFg = this.fgIndex.value; + const prevBg = this.bgIndex.value; + + this.fgIndex.selectedIndex = prevBg; + this.bgIndex.selectedIndex = prevFg; + } } // if (event.altKey && this.heldColorPick === undefined) {