aboutsummaryrefslogtreecommitdiff
path: root/converter/adb_usb/matrix.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-03-12 12:10:12 +0900
committertmk <nobody@nowhere>2013-03-12 12:10:12 +0900
commitc4ab832be0f110a127b20e8df2b5223bceb8dcd1 (patch)
tree62c7f90ab55af319f7ce62c3cc7fd5cdab463280 /converter/adb_usb/matrix.c
parentc0137b4b32f10d6a5b5a405ccd284b4194fe2497 (diff)
downloadqmk_firmware-c4ab832be0f110a127b20e8df2b5223bceb8dcd1.tar.gz
qmk_firmware-c4ab832be0f110a127b20e8df2b5223bceb8dcd1.zip
Fix Locking CapsLock support in ADB converter
Diffstat (limited to 'converter/adb_usb/matrix.c')
-rw-r--r--converter/adb_usb/matrix.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c
index 18e71aa49..9b26a2a18 100644
--- a/converter/adb_usb/matrix.c
+++ b/converter/adb_usb/matrix.c
@@ -25,8 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
25#include "print.h" 25#include "print.h"
26#include "util.h" 26#include "util.h"
27#include "debug.h" 27#include "debug.h"
28#include "host.h"
29#include "led.h"
30#include "adb.h" 28#include "adb.h"
31#include "matrix.h" 29#include "matrix.h"
32 30
@@ -38,8 +36,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
38# error "MATRIX_ROWS must not exceed 255" 36# error "MATRIX_ROWS must not exceed 255"
39#endif 37#endif
40 38
41#define ADB_CAPS_UP (ADB_CAPS | 0x80)
42
43 39
44static bool is_modified = false; 40static bool is_modified = false;
45 41
@@ -98,12 +94,6 @@ uint8_t matrix_scan(void)
98 print("adb_host_kbd_recv: "); phex16(codes); print("\n"); 94 print("adb_host_kbd_recv: "); phex16(codes); print("\n");
99 } 95 }
100 96
101#ifdef MATRIX_HAS_LOCKING_CAPS
102 // Send Caps key up event
103 if (matrix_is_on(MATRIX_ROW(ADB_CAPS), MATRIX_COL(ADB_CAPS))) {
104 register_key(ADB_CAPS_UP);
105 }
106#endif
107 if (codes == 0) { // no keys 97 if (codes == 0) { // no keys
108 return 0; 98 return 0;
109 } else if (codes == 0x7F7F) { // power key press 99 } else if (codes == 0x7F7F) { // power key press
@@ -116,23 +106,6 @@ uint8_t matrix_scan(void)
116 for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; 106 for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
117 return key1; 107 return key1;
118 } else { 108 } else {
119#ifdef MATRIX_HAS_LOCKING_CAPS
120 if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
121 // Ignore LockingCaps key down event when CAPS LOCK is on
122 if (key0 == ADB_CAPS && (key1 == ADB_CAPS || key1 == 0xFF)) return 0;
123 if (key0 == ADB_CAPS) key0 = key1;
124 if (key1 == ADB_CAPS) key1 = 0xFF;
125 // Convert LockingCaps key up event into down event
126 if (key0 == ADB_CAPS_UP) key0 = ADB_CAPS;
127 if (key1 == ADB_CAPS_UP) key1 = ADB_CAPS;
128 } else {
129 // ADB_CAPS LOCK off:
130 // Ignore LockingCaps key up event when ADB_CAPS LOCK is off
131 if (key0 == ADB_CAPS_UP && (key1 == ADB_CAPS_UP || key1 == 0xFF)) return 0;
132 if (key0 == ADB_CAPS_UP) key0 = key1;
133 if (key1 == ADB_CAPS_UP) key1 = 0xFF;
134 }
135#endif
136 register_key(key0); 109 register_key(key0);
137 if (key1 != 0xFF) // key1 is 0xFF when no second key. 110 if (key1 != 0xFF) // key1 is 0xFF when no second key.
138 register_key(key1); 111 register_key(key1);