]> git.gir.st - tmk_keyboard.git/blob - ps2_usb/README
Change layer pram and keymap of HHKB. Fix vusb/host.c.
[tmk_keyboard.git] / ps2_usb / README
1 PS/2 to USB keyboard converter
2 ==============================
3
4 This firmware converts PS/2 keyboard protocol to USB.
5
6
7 Demostration build
8 ------------------
9 In this demo build, you can try several layouts,
10 mouse keys and USB NKRO.
11
12 Special keys:
13 Magic+0: Qwerty with mouse keys(default)
14 Magic+1: Qwerty
15 Magic+2: Colemak
16 Magic+3: Dvorak
17 Magic+4: Workman
18 Magic+N: toggles NKRO/6KRO(6KRO by default)
19 Magic+Esc: sends Power Event
20 where Magic=(LShift+RShift) or (LControl+RShift)
21
22 Keybinds:
23 Fn0+(hjkl): Mouse key move(vi cursor)
24 Fn0+(yuio): Mouse wheel(left,down,up,right)
25 Fn0+space: Mouse button1
26 Fn0+(mnb): Mouse buttons(1,2,3)
27 Fn0+(zxc): Media control(Volup, Voldown, Mute)
28 Fn1+(hjkl): Cursor move(vi cursor)
29 Fn1+(nm,.): Cursor move(Home,PageDown,PageUp,End)
30
31 Fn2+(esdf): Mouse key move(invert T cursor)
32 Fn2+(qwrt): Mouse wheel(left,down,up,right)
33 Fn2+space: Mouse button1
34 Fn2+(,./): Media control(Volup, Voldown, Mute)
35 where Fn0=;, Fn1=/, Fn2=a
36
37
38 Features
39 --------
40 Mouse keys
41 You can emulates mouse move and button click using keyboard.
42 System/Media control
43 You can sends Power event, Volume down/up and Mute.
44 USB NKRO(actually 120KRO+8Modifiers)
45 You can tolggles NKRO/6KRO.(Not tested on Mac.)
46 Keymap customization
47 You can customize keymaps easily by editing source code.
48
49
50 Build for Teensy
51 ----------------
52 0. Connect PS/2 keyboard to Teensy by 4 lines(Vcc, GND, Data, Clock).
53 1. Define following macros for PS/2 connection in config_pjrc.h:
54 PS2_DATA_PORT
55 PS2_DATA_PIN
56 PS2_DATA_DDR
57 PS2_DATA_BIT
58 PS2_CLOCK_PORT
59 PS2_CLOCK_PIN
60 PS2_CLOCK_DDR
61 PS2_CLOCK_BIT
62 2. Edit Makefile for build options and MCU setting.
63 2. make
64 3. program Teensy.
65 http://www.pjrc.com/teensy/loader.html
66
67
68 Build for V-USB
69 ---------------
70 0. Build V-USB controller board and connect PS/2 keyboard.
71 1. Define macros in config_vusb.h if needed.
72 2. Edit Makefile.vusb for build options and MCU setting.
73 3. make -f Makefile.vusb
74 4. program your V-USB controller.
75
76
77 V-USB Circuit
78 -------------
79 +---+ +---------------+
80 USB GND | | ATmega168 |
81 === C3 | |
82 5V <-------+--------+---|Vcc,AVCC | PS/2
83 R1 | | ====
84 D- <----+--+-----R2-----|INT1 RXD|------->DATA
85 D+ <----|---+----R3-----|INT0 XCK|------->CLOCK
86 Z1 Z2 | | ->5V
87 GND<----+---+--+--+-----|GND | ->GND
88 | | | |
89 | C2-+--|XTAL1 |
90 | X1 | |
91 +--C3-+--|XTAL2 |
92 +---------------+
93 R1: 1.5K Ohm
94 R2,R3: 68 Ohm
95 Z1,Z2: Zenner 3.6V
96 C1,C2: 22pF
97 C3: 0.1uF
98 X1: Crystal 20MHz(16MHz/12MHz)
99
100
101 Keymap
102 ------
103 You can change a keymap by editing code of keymap.c like following.
104 How to define the keymap is probably obvious. You can find key
105 symbols in usb_keycodes.h.
106 If you want to define more than one keymap, see hhkb/keymap.c and
107 macway/keymap.c as examples. To define keymap(layer) switching may
108 needs a bit of your effort at this time.
109
110 /* Default Layer: plain keymap
111 * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------.
112 * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak|
113 * `---' `---------------' `---------------' `---------------' `-----------' `-----------'
114 * ,-----------------------------------------------------------. ,-----------. ,---------------.
115 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -|
116 * |-----------------------------------------------------------| |-----------| |---------------|
117 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| |
118 * |-----------------------------------------------------------| `-----------' |-----------| +|
119 * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| |
120 * |-----------------------------------------------------------| ,---. |---------------|
121 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
122 * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
123 * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| |
124 * `-----------------------------------------------------------' `-----------' `---------------'
125 */
126 KEYMAP(
127 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, PWR, F13, F14,
128 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
129 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9,
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,
132 LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
133 ),
134
135
136 Multimedia keys
137 ---------------
138 Following lists PS/2 special keys supported by Windows.
139 http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx
140
141 Key PS/2(Set2) HID
142 ---------------------------------------------------
143 System Power E0 37 01 0081
144 System Sleep E0 3F 01 0082
145 System Wake E0 5E 01 0083
146 System Mute E0 23 0C 00E2
147 Volume Up E0 32 0C 00E9
148 Volume Down E0 21 0C 00EA
149 Scan Next Track E0 4D 0C 00B5
150 Scan Previous Track E0 15 0C 00B6
151 Stop E0 3B 0C 00B7
152 Play/Pause E0 34 0C 00CD
153 Media Select E0 50 0C 0183
154 Mail E0 48 0C 018A
155 Calculator E0 2B 0C 0192
156 My Computer E0 40 0C 0194
157 WWW Search E0 10 0C 0221
158 WWW Home E0 3A 0C 0223
159 WWW Back E0 38 0C 0224
160 WWW Forward E0 30 0C 0225
161 WWW Stop E0 28 0C 0226
162 WWW Refresh E0 20 0C 0227
163 WWW Favorites E0 18 0C 022A
164
165
166 EOF
Imprint / Impressum