From 40a88c0cbf98fee9f06382ca205db65f647eed04 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 22 Jan 2016 15:14:17 -0800 Subject: [PATCH] Switch from explicitly releasing keys to just assuming a fresh key report on every scan --- KeyboardioFirmware.h | 1 - KeyboardioFirmware.ino | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/KeyboardioFirmware.h b/KeyboardioFirmware.h index d3f786ec..fdf58005 100644 --- a/KeyboardioFirmware.h +++ b/KeyboardioFirmware.h @@ -89,7 +89,6 @@ void handle_mouse_key_press(byte switchState, Key mappedKey, char &x, char &y); void send_key_events(); void send_key_event(byte row, byte col); void press_key(Key mappedKey); -void release_key(Key mappedKey); int setup_sx1509(sx1509Class sx1509, int colpins[], int rowpins[]); diff --git a/KeyboardioFirmware.ino b/KeyboardioFirmware.ino index 483ed04d..5ca0821f 100644 --- a/KeyboardioFirmware.ino +++ b/KeyboardioFirmware.ino @@ -140,6 +140,7 @@ void scan_matrix() { } TS("Sending key report"); Keyboard.sendReport(); + Keyboard.releaseAll(); handle_mouse_movement(x, y); } @@ -401,11 +402,7 @@ void send_key_event(byte row, byte col) { handle_synthetic_key_press(switchState, mappedKey); } else { if (key_is_pressed(switchState)) { - if (key_toggled_on (switchState)) { press_key(mappedKey); - } - } else if (key_toggled_off (switchState)) { - release_key(mappedKey); } @@ -431,16 +428,6 @@ void press_key(Key mappedKey) { } } -void release_key(Key mappedKey) { - if (mappedKey.flags & SHIFT_HELD) { - Keyboard.release(Key_LShift.rawKey); - } - - Keyboard.release(mappedKey.rawKey); -} - - - void make_input(sx1509Class sx1509, int pin) { sx1509.pinDir(pin, INPUT); // Set SX1509 pin 1 as an input sx1509.writePin(pin, HIGH); // Activate pull-up