From 68e933e08a1236a3bd69725f7ec4342237a89ae0 Mon Sep 17 00:00:00 2001 From: hkc Date: Mon, 22 Apr 2024 16:27:44 +0300 Subject: [PATCH] More sounds and also using interactive sfxc mode --- contrib/typewriter.sh | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/contrib/typewriter.sh b/contrib/typewriter.sh index ea7041b..5012a0f 100644 --- a/contrib/typewriter.sh +++ b/contrib/typewriter.sh @@ -5,34 +5,35 @@ KEYBOARD_ID="AT Translated Set 2 keyboard" b_isColon=false -KEY_ENTER=36 -KEY_SEMICOLON=47 -KEY_BACKSPACE=22 -KEY_3=12 - xinput test "$KEYBOARD_ID" | while read -r line; do if [[ "$line" =~ "key press" ]]; then keycode="$(echo "$line" | awk '{print$3}')" case "$keycode" in - "$KEY_ENTER") + 36) # enter b_isColon=false; - sfxc play typewriter/pc_on;; - "$KEY_BACKSPACE") + echo play typewriter/pc_on;; # OneShot:SE/pc_on.wav + 22) # backspace b_isColon=false; - sfxc play typewriter/bwomp;; - "$KEY_SEMICOLON") + echo play typewriter/bwomp;; + 111 | 113 | 114 |116) # arrows + b_isColon=false; + echo play typewriter/arrow;; # OneShot:SE/menu_cursor.wav + 112 | 117) # page up / page down + b_isColon=false; + echo play typewriter/page;; # OneShot:SE/page.wav + 47) # ":" b_isColon=true; - sfxc play typewriter/text;; - "$KEY_3") + echo play typewriter/text;; # OneShot:SE/text.wav + 12) # "3" if [ "$b_isColon" = "true" ]; then - sfxc play typewriter/meow; + echo play typewriter/meow; # Minecraft:entity.cat.meow else - sfxc play typewriter/text; + echo play typewriter/text; # OneShot:SE/text.wav fi; ;; *) b_isColon=false; - sfxc play typewriter/text;; + echo play typewriter/text;; # OneShot:SE/text.wav esac; fi; -done +done | sfxc