aboutsummaryrefslogtreecommitdiff
path: root/converter/adb_usb
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2012-09-20 13:02:42 +0900
committertmk <nobody@nowhere>2012-09-21 10:51:44 +0900
commit9f05dc6f444e159af3805baf5117be4d0da2d349 (patch)
tree75b884349601e43cdf1b8763ee037a6cb09d750b /converter/adb_usb
parentd8ce19abd06ee9274cee883a379504eba9b470a5 (diff)
downloadqmk_firmware-9f05dc6f444e159af3805baf5117be4d0da2d349.tar.gz
qmk_firmware-9f05dc6f444e159af3805baf5117be4d0da2d349.zip
Change keymap of ADB converter.
Diffstat (limited to 'converter/adb_usb')
-rw-r--r--converter/adb_usb/Makefile3
-rw-r--r--converter/adb_usb/README.md (renamed from converter/adb_usb/README)45
-rw-r--r--converter/adb_usb/config.h27
-rw-r--r--converter/adb_usb/keymap.c16
4 files changed, 45 insertions, 46 deletions
diff --git a/converter/adb_usb/Makefile b/converter/adb_usb/Makefile
index e9a90695b..87b0f415b 100644
--- a/converter/adb_usb/Makefile
+++ b/converter/adb_usb/Makefile
@@ -35,8 +35,7 @@ F_CPU = 16000000
35# Build Options 35# Build Options
36# comment out to disable the options. 36# comment out to disable the options.
37# 37#
38MOUSEKEY_ENABLE = yes # Mouse keys 38#MOUSEKEY_ENABLE = yes # Mouse keys
39#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
40EXTRAKEY_ENABLE = yes # Audio control and System control 39EXTRAKEY_ENABLE = yes # Audio control and System control
41#NKRO_ENABLE = yes # USB Nkey Rollover 40#NKRO_ENABLE = yes # USB Nkey Rollover
42 41
diff --git a/converter/adb_usb/README b/converter/adb_usb/README.md
index 5d0e1bc86..a41d84ebb 100644
--- a/converter/adb_usb/README
+++ b/converter/adb_usb/README.md
@@ -1,34 +1,39 @@
1ADB to USB keyboard converter 1ADB to USB keyboard converter
2============================= 2=============================
3http://geekhack.org/showwiki.php?title=Island:14290
4
5This firmware converts ADB keyboard protocol to USB. 3This firmware converts ADB keyboard protocol to USB.
4You can use PJRC Teensy for this converter, though, other USB AVR(ATMega32U4, AT90USB64/128 or etc) should work.
5But binary size is about 10KB or more it doesn't fit into 8K flash like ATMega8U2.
6
7Discuss: http://geekhack.org/showwiki.php?title=Island:14290
6 8
7 9
8Build 10Build
9----- 11-----
100. Connect ADB keyboard to Teensy by 3 lines(Vcc, GND, Data). 120. Connect ADB keyboard to Teensy by 3 lines(Vcc, GND, Data). By default Data line uses port F0.
11 You need a external pull-up resistor on DATA line in most case, 13 This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable.
12 in particular when you want to use a long or coiled cable. 14 The external pull-up resistor(1K-10K Ohm) on Data is strongly recommended.
13 This converter uses AVR's internal pull-up, but it seems to be too weak. 151. Define following macros for ADB connection in config.h if you use other than port F0.
14 The external pull-up resistor is strongly recommended. 16 ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT
15 PSW line is optional. See ADB.txt for details.
161. Define following macros for ADB connection in config.h:
17 ADB_PORT
18 ADB_PIN
19 ADB_DDR
20 ADB_DATA_BIT
21 ADB_PSW_BIT
222. make 172. make
233. program Teensy. 183. program Teensy
19
20
21LOCKING CAPSLOCK
22----------------
23Many old ADB keyboards have mechanical push-lock switch for Capslock key. This converter support the locking Capslock key by default.
24This 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
28Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch.
29http://www.youtube.com/watch?v=9wqnt2mGJ2Y
24 30
25 31
26Keymap 32Keymap
27------ 33------
28You can change a keymap by editing code of keymap.c like following. 34You can change a keymap by editing code of keymap.c like following.
29This is a keymap for AEK, however, also used for other keyboards. 35This is a keymap for AEK, however, also used for other keyboards.
30How to define the keymap is probably obvious. You can find key 36How to define the keymap is probably obvious. You can find key symbols in usb_keycodes.h.
31symbols in usb_keycodes.h.
32If you want to define some keymaps than just one, see hhkb/keymap.c and 37If you want to define some keymaps than just one, see hhkb/keymap.c and
33macway/keymap.c as examples. Keymap(layer) switching may needs a bit of 38macway/keymap.c as examples. Keymap(layer) switching may needs a bit of
34effort at this time. 39effort at this time.
@@ -59,6 +64,11 @@ effort at this time.
59 ), 64 ),
60 65
61 66
67Magic command
68-------------
69To get help press `h` holding Magic key. Magic key is `Power key`.
70
71
62Notes 72Notes
63----- 73-----
64Many ADB keyboards has no discrimination between right modifier and left one, 74Many ADB keyboards has no discrimination between right modifier and left one,
@@ -66,5 +76,6 @@ you will always see left control even if you press right control key.
66Apple Extended Keyboard and Apple Extended Keyboard II are the examples. 76Apple Extended Keyboard and Apple Extended Keyboard II are the examples.
67Though ADB protocol itsef has the ability of distinction between right and left. 77Though ADB protocol itsef has the ability of distinction between right and left.
68And most ADB keyboard has no NKRO functionality, though ADB protocol itsef has that. 78And most ADB keyboard has no NKRO functionality, though ADB protocol itsef has that.
79See protocol/adb.c for more info.
69 80
70EOF 81EOF
diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h
index 52d5925a5..875c48ce8 100644
--- a/converter/adb_usb/config.h
+++ b/converter/adb_usb/config.h
@@ -35,12 +35,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
35/* Locking Caps Lock support */ 35/* Locking Caps Lock support */
36#define MATRIX_HAS_LOCKING_CAPS 36#define MATRIX_HAS_LOCKING_CAPS
37 37
38 38#define MATRIX_ROW(code) ((code)>>3&0x0F)
39/* key combination for command */ 39#define MATRIX_COL(code) ((code)&0x07)
40#define IS_COMMAND() ( \
41 keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_LCTRL) | MOD_BIT(KB_LALT) | MOD_BIT(KB_LGUI)) || \
42 keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)) \
43)
44 40
45 41
46/* mouse keys */ 42/* mouse keys */
@@ -49,19 +45,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
49#endif 45#endif
50 46
51 47
52/* PS/2 mouse */
53#ifdef PS2_MOUSE_ENABLE
54# define PS2_CLOCK_PORT PORTF
55# define PS2_CLOCK_PIN PINF
56# define PS2_CLOCK_DDR DDRF
57# define PS2_CLOCK_BIT 0
58# define PS2_DATA_PORT PORTF
59# define PS2_DATA_PIN PINF
60# define PS2_DATA_DDR DDRF
61# define PS2_DATA_BIT 1
62#endif
63
64
65/* ADB port setting */ 48/* ADB port setting */
66#define ADB_PORT PORTF 49#define ADB_PORT PORTF
67#define ADB_PIN PINF 50#define ADB_PIN PINF
@@ -69,4 +52,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
69#define ADB_DATA_BIT 0 52#define ADB_DATA_BIT 0
70//#define ADB_PSW_BIT 1 // optional 53//#define ADB_PSW_BIT 1 // optional
71 54
55/* key combination for command */
56#include "adb.h"
57#define IS_COMMAND() ( \
58 matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \
59)
60
72#endif 61#endif
diff --git a/converter/adb_usb/keymap.c b/converter/adb_usb/keymap.c
index 2d1657933..c6827f1d5 100644
--- a/converter/adb_usb/keymap.c
+++ b/converter/adb_usb/keymap.c
@@ -96,7 +96,7 @@ static const uint8_t PROGMEM fn_layer[] = {
96// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. 96// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
97// See layer.c for details. 97// See layer.c for details.
98static const uint8_t PROGMEM fn_keycode[] = { 98static const uint8_t PROGMEM fn_keycode[] = {
99 KB_NO, // Fn0 99 KB_BSLS, // Fn0
100 KB_NO, // Fn1 100 KB_NO, // Fn1
101 KB_NO, // Fn2 101 KB_NO, // Fn2
102 KB_NO, // Fn3 102 KB_NO, // Fn3
@@ -109,7 +109,7 @@ static const uint8_t PROGMEM fn_keycode[] = {
109static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 109static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
110 /* Default Layer: plain keymap 110 /* Default Layer: plain keymap
111 * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. 111 * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---.
112 * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Fn0| 112 * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|
113 * `---' `---------------' `---------------' `---------------' `-----------' `---' 113 * `---' `---------------' `---------------' `---------------' `-----------' `---'
114 * ,-----------------------------------------------------------. ,-----------. ,---------------. 114 * ,-----------------------------------------------------------. ,-----------. ,---------------.
115 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| 115 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *|
@@ -124,9 +124,9 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
124 * `-----------------------------------------------------------' `-----------' `---------------' 124 * `-----------------------------------------------------------' `-----------' `---------------'
125 */ 125 */
126 KEYMAP( 126 KEYMAP(
127 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, FN0, 127 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, NO,
128 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, 128 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST,
129 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, 129 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,FN0, DEL, END, PGDN, P7, P8, P9, PMNS,
130 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, 130 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS,
131 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, 131 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3,
132 LCTL,LGUI,LALT, SPC, LEFT,DOWN,RGHT, P0, PDOT,PENT 132 LCTL,LGUI,LALT, SPC, LEFT,DOWN,RGHT, P0, PDOT,PENT
@@ -134,12 +134,12 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
134 134
135 /* Default Layer: plain keymap 135 /* Default Layer: plain keymap
136 * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. 136 * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---.
137 * |` | |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Fn0| 137 * |` | |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|
138 * `---' `---------------' `---------------' `---------------' `-----------' `---' 138 * `---' `---------------' `---------------' `---------------' `-----------' `---'
139 * ,-----------------------------------------------------------. ,-----------. ,---------------. 139 * ,-----------------------------------------------------------. ,-----------. ,---------------.
140 * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | |Ins|Hom|PgU| |NmL|Mb1|Mb2|Mb3| 140 * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | |Ins|Hom|PgU| |NmL|Mb1|Mb2|Mb3|
141 * |-----------------------------------------------------------| |-----------| |---------------| 141 * |-----------------------------------------------------------| |-----------| |---------------|
142 * |Tab | Q| W| E| R| T| Y| U|PrS|ScL|Pau|Up |Ins| \| |Del|End|PgD| |MwD|McU|MwU|MwD| 142 * |Tab | Q| W| E| R| T| Y| U|PrS|ScL|Pau|Up |Ins| Fn0| |Del|End|PgD| |MwD|McU|MwU|MwD|
143 * |-----------------------------------------------------------| `-----------' |---------------| 143 * |-----------------------------------------------------------| `-----------' |---------------|
144 * |CapsLo|VoD|VoU|Mut| F| G| H| J|Hom|PgU|Lef|Rig|Return | |McL|McD|McR|MwU| 144 * |CapsLo|VoD|VoU|Mut| F| G| H| J|Hom|PgU|Lef|Rig|Return | |McL|McD|McR|MwU|
145 * |-----------------------------------------------------------| ,---. |---------------| 145 * |-----------------------------------------------------------| ,---. |---------------|
@@ -149,9 +149,9 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
149 * `-----------------------------------------------------------' `-----------' `---------------' 149 * `-----------------------------------------------------------' `-----------' `---------------'
150 */ 150 */
151 KEYMAP( 151 KEYMAP(
152 GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, FN0, 152 GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, NO,
153 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,BTN1,BTN2,BTN3, 153 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,BTN1,BTN2,BTN3,
154 TAB, Q, W, E, R, T, Y, U, PSCR,SLCK,PAUS,UP, INS, BSLS, DEL, END, PGDN, WH_D,MS_U,WH_U,WH_D, 154 TAB, Q, W, E, R, T, Y, U, PSCR,SLCK,PAUS,UP, INS, FN0, DEL, END, PGDN, WH_D,MS_U,WH_U,WH_D,
155 CAPS,VOLD,VOLU,MUTE,F, G, H, J, HOME,PGUP,LEFT,RGHT, ENT, MS_L,MS_D,MS_R,WH_U, 155 CAPS,VOLD,VOLU,MUTE,F, G, H, J, HOME,PGUP,LEFT,RGHT, ENT, MS_L,MS_D,MS_R,WH_U,
156 LSFT,Z, X, C, V, B, N, M, END, PGDN,DOWN, RSFT, PGUP, WH_L,MS_D,WH_R, 156 LSFT,Z, X, C, V, B, N, M, END, PGDN,DOWN, RSFT, PGUP, WH_L,MS_D,WH_R,
157 LCTL,LGUI,LALT, SPC, HOME,PGDN,END, BTN1, BTN2,BTN3 157 LCTL,LGUI,LALT, SPC, HOME,PGDN,END, BTN1, BTN2,BTN3