Merge branch 'macro_mediakey'(Fix issue #42)
[tmk_keyboard.git] / README.md
CommitLineData
78fd5a71 1TMK Keyboard Firmware Collection
2================================
3This is a keyboard firmware with some useful features for Atmel AVR controller.
afb08462 4
5Source code is available here: <http://github.com/tmk/tmk_keyboard>
6
7
8Features
9--------
78fd5a71 10These features can be used in your keyboard.
11
633d9aa5 12* Multi-layer Keymap - Multiple keyboard layouts with layer switching
74ecdd15 13* Mouse key - Mouse control with keyboard
14* System Control Key - Power Down, Sleep, Wake Up and USB Remote Wake up
15* Media Control Key - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
16* USB NKRO - 120 keys(+ 8 modifiers) simultaneously
17* PS/2 mouse support - PS/2 mouse(TrackPoint) as composite device
18* Keyboard protocols - PS/2, ADB, M0110, Sun and other old keyboard protocols
19* User Function - Customizable function of key with writing code
20* Macro - Very primitive at this time
21* Keyboard Tricks - Oneshot modifier and modifier with tapping feature
22* Debug Console - Messages for debug and interaction with firmware
8b9bd51d 23* Virtual DIP Switch - Configurations stored EEPROM(Boot Magic)
c0137b4b 24* Locking CapsLock - Mechanical switch support for CapsLock
0142e20b 25* Breathing Sleep LED - Sleep indicator with charm during USB suspend
1eb8523e 26* Backlight - Control backlight levels
afb08462 27
28
29Projects
30--------
083c7581 31You can find some keyboard specific projects under `converter` and `keyboard` directory.
32
afb08462 33### converter
1aa067e5 34* [ps2_usb](converter/ps2_usb/) - [PS/2 keyboard to USB][GH_ps2]
35* [adb_usb](converter/adb_usb/) - [ADB keyboard to USB][GH_adb]
36* [m0110_usb](converter/m0110_usb) - [Machintosh 128K/512K/Plus keyboard to USB][GH_m0110]
37* [terminal_usb](converter/terminal_usb/) - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
38* [news_usb](converter/news_usb/) - [Sony NEWS keyboard to USB][GH_news]
39* [x68k_usb](converter/x68k_usb/) - [Sharp X68000 keyboard to USB][GH_x68k]
633d9aa5 40* [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?)
41* [pc98_usb](converter/pc98_usb/) - [PC98] to USB
1aa067e5 42* [usb_usb](converter/usb_usb/) - USB to USB(experimental)
afb08462 43
44### keyboard
78fd5a71 45* [hhkb](keyboard/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] **my main board**
46* [gh60](keyboard/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] **my second board**
47* [hbkb](keyboard/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
48* [hid_liber](keyboard/hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
49* [phantom](keyboard/phantom/) - [Phantom] keyboard (by Tranquilite)
5808317b 50* [IIgs_Standard](keyboard/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
78fd5a71 51* [macway](keyboard/macway/) - [Compact keyboard mod][GH_macway] [retired]
43e5ca60 52* [KMAC](keyboard/kmac/) - Korean custom keyboard
784c6e39 53
afb08462 54[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
55[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
56[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
57[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
58[GH_hhkb_bt]: http://geekhack.org/showwiki.php?title=Island:20851
59[GH_m0110]: http://geekhack.org/showwiki.php?title=Island:24965
81706d11 60[GH_news]: http://geekhack.org/showwiki.php?title=Island:25759
afb08462 61[GH_terminal]: http://geekhack.org/showwiki.php?title=Island:27272
62[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
81706d11 63[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
74ecdd15 64[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
78fd5a71 65[Phantom]: http://geekhack.org/index.php?topic=26742
74ecdd15 66[GH60]: http://geekhack.org/index.php?topic=34959
78fd5a71 67[GH60_proto]: http://geekhack.org/index.php?topic=37570.0
633d9aa5 68[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
69[Sun]: http://en.wikipedia.org/wiki/Sun-3
70[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
afb08462 71
72
73
78fd5a71 74License
75-------
76**GPLv2** or later. Some protocol files are under **Modified BSD License**.
77LUFA, PJRC and V-USB stack have their own license respectively.
74ecdd15 78
afb08462 79
784c6e39 80
78fd5a71 81Build Firmware and Program Controller
82-------------------------------------
83See [doc/build.md](doc/build.md).
afb08462 84
afb08462 85
86
083c7581 87Change your keymap
88------------------
78fd5a71 89See [doc/keymap.md](doc/keymap.md).
afb08462 90
91
74ecdd15 92
93Magic Comannds
94--------------
95To see help press `Magic` + `H`.
96
97 `Magic` key bind may be `LShift` + `RShift` in many project, but `Power` key on ADB converter. `Magic` keybind can be vary on each project, check `config.h` in project directory.
98
99Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
100
101 ----- Command Help -----
102 c: enter console mode
103 d: toggle debug enable
104 x: toggle matrix debug
105 k: toggle keyboard debug
106 m: toggle mouse debug
74ecdd15 107 v: print device version & info
108 t: print timer count
109 s: print status
4e93b3fa 110 e: print eeprom config
111 n: toggle NKRO
74ecdd15 112 0/F10: switch to Layer0
113 1/F1: switch to Layer1
114 2/F2: switch to Layer2
115 3/F3: switch to Layer3
116 4/F4: switch to Layer4
117 PScr: power down/remote wake-up
118 Caps: Lock Keyboard(Child Proof)
119 Paus: jump to bootloader
120
8b9bd51d 121**TBD**
39d09333 122
4e93b3fa 123### Boot Magic Configuration - Virtual DIP Switch
8b9bd51d 124Boot Magic are executed during boot up time. Press Magic key below then pulgin keyboard cable.
4e93b3fa 125Note that you must use keys of **Layer 0** as Magic keys. These settings are stored in EEPROM so that retain your configure over power cycles.
39d09333 126
dad9dab9 127#### General
128- Skip reading EEPROM to start with default configuration(`ESC`)
129- Clear configuration stored in EEPROM to reset configuration(`Backspace`)
4e93b3fa 130
131#### Bootloader
8b9bd51d 132- Kick up Bootloader(`B`)
4e93b3fa 133
134#### Debug
8b9bd51d 135- Debug enable(`D`)
4e93b3fa 136- Debug matrix enable(`D`+`X`)
137- Debug keyboard enable(`D`+`K`)
138- Debug mouse enable(`D`+`M`)
139
140#### Keymap
8b9bd51d 141- Swap Control and CapsLock(`Left Control`)
142- Change CapsLock to Control(`Casp Lock`)
143- Swap LeftAlt and Gui(`Left Alt`)
144- Swap RightAlt and Gui(`Right Alt`)
145- Disable Gui(`Left Gui`)
146- Swap Grave and Escape(`Grave`)
147- Swap BackSlash and BackSpace(`Back Slash`)
39d09333 148
4e93b3fa 149#### Default Layer
150- Set Default Layer to 0(`0`)
dad9dab9 151- Set Default Layer to 1(`1`)
152- Set Default Layer to 2(`2`)
153- Set Default Layer to 3(`3`)
9de9d719 154- Set Default Layer to 4(`4`)
155- Set Default Layer to 5(`5`)
156- Set Default Layer to 6(`6`)
157- Set Default Layer to 7(`7`)
158
159#### Caution
160Unintentional use of this feature will cause user confusion.
161
162TODO: Magic key combination to avoid unintentional press during plug in
4e93b3fa 163
8b9bd51d 164**TBD**
39d09333 165
74ecdd15 166
c0137b4b 167Mechanical Locking support for CapsLock
168---------------------------------------
169To enable this feature define these two macros in `config.h` and use `KC_LCAP` for locking CapsLock in keymap instead of normal `KC_CAPS`. Resync option tries to keep lock switch state consistent with keyboard LED state.
170
171 #define CAPSLOCK_LOCKING_ENABLE
172 #define CAPSLOCK_LOCKING_RESYNC_ENABLE
173
74ecdd15 174
175Start Your Own Project
afb08462 176-----------------------
0142e20b 177**TBD**
41bf9204 178### Config.h Options
179#### 1. USB vendor/product ID and device description
180 #define VENDOR_ID 0xFEED
181 #define PRODUCT_ID 0xBEEF
41bf9204 182 #define MANUFACTURER t.m.k.
183 #define PRODUCT Macway mod
184 #define DESCRIPTION t.m.k. keyboard firmware for Macway mod
185
186#### 2. Keyboard matrix configuration
187 #define MATRIX_ROWS 8
188 #define MATRIX_COLS 8
189 #define MATRIX_HAS_GHOST
190
afb08462 191
afb08462 192
78fd5a71 193Architecture
194------------
195 Architecture Diagram
196 +---------------+---------------+-------------+
197 | Host | Keyboard | Matrix, LED |
198 ___________ |-----------+-+ +-------------+ | +-----------|
199 / /| Keys/Mouse | Protocol |d| | Action | | | Protocol |
200 /__________/ |<-----------| LUFA |r| | Layer, Tap | | | Matrix |
201 |.--------.| | LED | V-USB |i| |-------------| | | PS/2,IBM | __________________
202 || || |----------->| PJRC |v| | Keymap | | | ADB,M0110| Keys / /_/_/_/_/_/_/_/ /|
203 || Host || | Console | iWRAP(BT)|e| | Mousekey | | | SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
204 ||________||/.<-----------| UART |r| | Report | | | X68K/PC98| Control / /_/_/_/_/_/_/_/ / /
205 `_========_'/| |---------------------------------------------|-------->/___ /_______/ ___/ /
206 |_o______o_|/ | Sendchar, Print, Debug, Command, ... | |_________________|/
207 +---------------------------------------------+ Keyboard
208
209
210
211Debuging
212--------
213Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack.
afb08462 214
adbd15d5 215You can use xprintf() to display debug info on `hid_listen`, see `common/xprintf.h`.
78fd5a71 216
217
218
219Files and Directories
74ecdd15 220-------------------
221### Top
222* common/ - common codes
223* protocol/ - keyboard protocol support
224* keyboard/ - keyboard projects
225* converter/ - protocol converter projects
226* doc/ - documents
227* common.mk - Makefile for common
228* protoco.mk - Makefile for protocol
229* rules.mk - Makefile for build rules
230
231### Common
78fd5a71 232* host.h
0be309cc 233* host_driver.h
78fd5a71 234* keyboard.h
235* command.h
236* keymap.h
237* action.h
0be309cc 238* keycode.h
0be309cc 239* matrix.h
78fd5a71 240* led.h
241* mousekey.h
0be309cc 242* report.h
78fd5a71 243* debug.h
244* print.h
245* bootloader.h
0be309cc 246* sendchar.h
78fd5a71 247* timer.h
248* util.h
74ecdd15 249
250### Keyboard Protocols
251* lufa/ - LUFA USB stack
252* pjrc/ - PJRC USB stack
253* vusb/ - Objective Development V-USB
254* iwrap/ - Bluetooth HID for Bluegiga iWRAP
255* ps2.c - PS/2 protocol
256* adb.c - Apple Desktop Bus protocol
257* m0110.c - Macintosh 128K/512K/Plus keyboard protocol
258* news.c - Sony NEWS keyboard protocol
259* x68k.c - Sharp X68000 keyboard protocol
260* serial_soft.c - Asynchronous Serial protocol implemented by software
afb08462 261
afb08462 262
afb08462 263
de7b46cd 264Conding Style
265-------------
266- Doesn't use Tab to indent, use 4-spaces instead.
267
268
269
78fd5a71 270Other Keyboard Firmware Projects
271------------------
272See [doc/other_projects.md](doc/other_projects.md).
Imprint / Impressum