From 2a95fc2492f49a3e6f05b440832aef423cd4ed9e Mon Sep 17 00:00:00 2001 From: Dejvino Date: Thu, 25 Feb 2021 20:51:04 +0100 Subject: [PATCH] Added modifiers --- XtKeyboard.ino | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/XtKeyboard.ino b/XtKeyboard.ino index 51f1680..9e7ea18 100644 --- a/XtKeyboard.ino +++ b/XtKeyboard.ino @@ -14,6 +14,12 @@ int keyReleaseBit = 0x80; char m[255]; +// MODS +// play speaker sounds of keys +const bool modKeySounds = true; +// replace CapsLock with Super key (aka GUI or Windows key) +const bool modSuperCapslock = true; + void setupKeyMapping() { m[1]=KEY_ESC; m[2]='1'; @@ -72,7 +78,7 @@ void setupKeyMapping() { m[55]='\335'; // num-* m[56]=KEY_LEFT_ALT; m[57]=' '; - m[58]=KEY_CAPS_LOCK; // EVIL + m[58]=(modSuperCapslock ? KEY_LEFT_GUI : KEY_CAPS_LOCK); // EVIL m[59]=KEY_F1; m[60]=KEY_F2; m[61]=KEY_F3; @@ -84,6 +90,7 @@ void setupKeyMapping() { m[67]=KEY_F9; m[68]=KEY_F10; // https://forum.arduino.cc/index.php?topic=266688.msg1880644#msg1880644 + // http://www.quadibloc.com/comp/scan.htm const byte KEY_NUM_LOCK = 219; m[69]=KEY_NUM_LOCK; const byte KEY_SCROLL_LOCK = 207; @@ -166,7 +173,7 @@ void loop() { if(counter >= numbits) { //Serial.println(int(data)); processKbdByte(data); - tone(speakerPin, 60 + int(data), 25); + if (modKeySounds) tone(speakerPin, 60 + int(data), 25); data = B0; counter = 0; }