Switch from explicitly releasing keys to just assuming a fresh key report on every scan

pull/18/head
Jesse Vincent 9 years ago
parent 2b0e363b65
commit 40a88c0cbf

@ -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[]);

@ -140,6 +140,7 @@ void scan_matrix() {
}
TS("Sending key report");
Keyboard.sendReport();
Keyboard.releaseAll();
handle_mouse_movement(x, y);
}
@ -401,12 +402,8 @@ 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

Loading…
Cancel
Save