diff options
| -rw-r--r-- | converter/adb_usb/README.md | 7 | ||||
| -rw-r--r-- | converter/adb_usb/config.h | 15 | ||||
| -rw-r--r-- | converter/adb_usb/keymap.c | 2 | ||||
| -rw-r--r-- | converter/adb_usb/matrix.c | 27 | ||||
| -rw-r--r-- | keyboard/gh60/config.h | 2 |
5 files changed, 16 insertions, 37 deletions
diff --git a/converter/adb_usb/README.md b/converter/adb_usb/README.md index 33fd55040..3033cfa62 100644 --- a/converter/adb_usb/README.md +++ b/converter/adb_usb/README.md | |||
| @@ -20,10 +20,7 @@ Build | |||
| 20 | 20 | ||
| 21 | LOCKING CAPSLOCK | 21 | LOCKING CAPSLOCK |
| 22 | ---------------- | 22 | ---------------- |
| 23 | Many old ADB keyboards have mechanical push-lock switch for Capslock key. This converter support the locking Capslock key by default. | 23 | Many of old ADB keyboards have mechanical push-lock switch for Capslock key and this converter supports the locking Capslock key by default. See README in top directory for more detail about this feature. |
| 24 | This feature will prevent you from remaping as normal key. You can disable the feature by *commenting out* a macro in config.h like this: | ||
| 25 | |||
| 26 | //#define MATRIX_HAS_LOCKING_CAPS | ||
| 27 | 24 | ||
| 28 | Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch. | 25 | Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch. |
| 29 | http://www.youtube.com/watch?v=9wqnt2mGJ2Y | 26 | http://www.youtube.com/watch?v=9wqnt2mGJ2Y |
| @@ -58,7 +55,7 @@ effort at this time. | |||
| 58 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, PWR, | 55 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, PWR, |
| 59 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, | 56 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, |
| 60 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, | 57 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, |
| 61 | CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, | 58 | LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, |
| 62 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, | 59 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, |
| 63 | LCTL,LGUI,LALT, SPC, LEFT,DOWN,RGHT, P0, PDOT,PENT | 60 | LCTL,LGUI,LALT, SPC, LEFT,DOWN,RGHT, P0, PDOT,PENT |
| 64 | ), | 61 | ), |
diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h index 094252f74..da87eed6a 100644 --- a/converter/adb_usb/config.h +++ b/converter/adb_usb/config.h | |||
| @@ -32,13 +32,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 32 | #define MATRIX_ROWS 16 // keycode bit: 3-0 | 32 | #define MATRIX_ROWS 16 // keycode bit: 3-0 |
| 33 | #define MATRIX_COLS 8 // keycode bit: 6-4 | 33 | #define MATRIX_COLS 8 // keycode bit: 6-4 |
| 34 | 34 | ||
| 35 | /* Locking Caps Lock support */ | ||
| 36 | #define MATRIX_HAS_LOCKING_CAPS | ||
| 37 | |||
| 38 | #define MATRIX_ROW(code) ((code)>>3&0x0F) | 35 | #define MATRIX_ROW(code) ((code)>>3&0x0F) |
| 39 | #define MATRIX_COL(code) ((code)&0x07) | 36 | #define MATRIX_COL(code) ((code)&0x07) |
| 40 | 37 | ||
| 41 | 38 | ||
| 39 | /* Locking Caps Lock support */ | ||
| 40 | //#define MATRIX_HAS_LOCKING_CAPS | ||
| 41 | /* Mechanical locking CapsLock support. Use KC_LCAP instead of KC_CAPS in keymap */ | ||
| 42 | #define CAPSLOCK_LOCKING_ENABLE | ||
| 43 | /* Locking CapsLock resynchronize hack */ | ||
| 44 | #define CAPSLOCK_LOCKING_RESYNC_ENABLE | ||
| 45 | |||
| 46 | |||
| 47 | /* legacy keymap support */ | ||
| 48 | #define USE_LEGACY_KEYMAP | ||
| 49 | |||
| 50 | |||
| 42 | /* mouse keys */ | 51 | /* mouse keys */ |
| 43 | #ifdef MOUSEKEY_ENABLE | 52 | #ifdef MOUSEKEY_ENABLE |
| 44 | # define MOUSEKEY_DELAY_TIME 192 | 53 | # define MOUSEKEY_DELAY_TIME 192 |
diff --git a/converter/adb_usb/keymap.c b/converter/adb_usb/keymap.c index bde829de3..5d42980d5 100644 --- a/converter/adb_usb/keymap.c +++ b/converter/adb_usb/keymap.c | |||
| @@ -155,7 +155,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 155 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, PWR, | 155 | ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, PWR, |
| 156 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, | 156 | GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, |
| 157 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, | 157 | TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, |
| 158 | CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, | 158 | LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, |
| 159 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, | 159 | LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, |
| 160 | LCTL,LGUI,LALT, SPC, RGUI,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT | 160 | LCTL,LGUI,LALT, SPC, RGUI,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT |
| 161 | ), | 161 | ), |
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 | ||
| 44 | static bool is_modified = false; | 40 | static 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); |
diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h index bd0a19c33..38d88eecc 100644 --- a/keyboard/gh60/config.h +++ b/keyboard/gh60/config.h | |||
| @@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 39 | 39 | ||
| 40 | /* Mechanical locking CapsLock support. Use KC_LCAP instead of KC_CAPS in keymap */ | 40 | /* Mechanical locking CapsLock support. Use KC_LCAP instead of KC_CAPS in keymap */ |
| 41 | #define CAPSLOCK_LOCKING_ENABLE | 41 | #define CAPSLOCK_LOCKING_ENABLE |
| 42 | /* Locking CapsLock resynchronize hack, which won't work on Linux */ | 42 | /* Locking CapsLock resynchronize hack */ |
| 43 | #define CAPSLOCK_LOCKING_RESYNC_ENABLE | 43 | #define CAPSLOCK_LOCKING_RESYNC_ENABLE |
| 44 | 44 | ||
| 45 | /* key combination for command */ | 45 | /* key combination for command */ |
