forked from hkc/sfxd
1
0
Fork 0

More sounds and also using interactive sfxc mode

This commit is contained in:
Casey 2024-04-22 16:27:44 +03:00
parent 2dfbf934f4
commit 68e933e08a
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 17 additions and 16 deletions

View File

@ -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