]> git.gir.st - tmk_keyboard.git/blame_incremental - README.md
Merge pull request #148 from cub-uanic/patch-1
[tmk_keyboard.git] / README.md
... / ...
CommitLineData
1TMK Keyboard Firmware Collection
2================================
3This is a keyboard firmware with some useful features for Atmel AVR controller.
4
5Source code is available here: <http://github.com/tmk/tmk_keyboard>
6
7
8Features
9--------
10These features can be used in your keyboard.
11
12* Multi-layer Keymap - Multiple keyboard layouts with layer switching
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
23* Virtual DIP Switch - Configurations stored EEPROM(Boot Magic)
24* Locking CapsLock - Mechanical switch support for CapsLock
25* Breathing Sleep LED - Sleep indicator with charm during USB suspend
26* Backlight - Control backlight levels
27
28
29Projects
30--------
31You can find some keyboard specific projects under `converter` and `keyboard` directory.
32
33### converter
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) - [Macintosh 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]
40* [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?)
41* [pc98_usb](converter/pc98_usb/) - [PC98] to USB
42* [usb_usb](converter/usb_usb/) - USB to USB(experimental)
43* [ascii_usb](converter/ascii_usb/) - ASCII(Serial console terminal) to USB
44* [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard Converter][GH_ibm4704]
45
46### keyboard
47* [hhkb](keyboard/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] **my main board**
48* [gh60](keyboard/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] **my second board**
49* [hbkb](keyboard/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
50* [hid_liber](keyboard/hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
51* [phantom](keyboard/phantom/) - [Phantom] keyboard (by Tranquilite)
52* [IIgs_Standard](keyboard/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
53* [macway](keyboard/macway/) - [Compact keyboard mod][GH_macway] [retired]
54* [KMAC](keyboard/kmac/) - Korean custom keyboard
55* [Lightsaber](keyboard/lightsaber/) - Korean custom keyboard
56* [Infinity](keyboard/infinity/) - Massdrop [Infinity keyboard][Infinity]
57* [NerD](keyboard/nerd/) - Korean custom keyboard
58* [KittenPaw](keyboard/kittenpaw) - Custom Majestouch controller
59* [Lightpad](keyboard/lightpad) - Korean custom keypad
60* [ghost_squid](keyboard/ghost_squid/) - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]
61
62[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
63[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
64[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
65[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
66[GH_hhkb_bt]: http://geekhack.org/showwiki.php?title=Island:20851
67[GH_m0110]: http://geekhack.org/showwiki.php?title=Island:24965
68[GH_news]: http://geekhack.org/showwiki.php?title=Island:25759
69[GH_terminal]: http://geekhack.org/showwiki.php?title=Island:27272
70[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
71[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
72[GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
73[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
74[Phantom]: http://geekhack.org/index.php?topic=26742
75[GH60]: http://geekhack.org/index.php?topic=34959
76[GH60_proto]: http://geekhack.org/index.php?topic=37570.0
77[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
78[Sun]: http://en.wikipedia.org/wiki/Sun-3
79[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
80[Infinity]: https://www.massdrop.com/buy/infinity-keyboard-kit
81[ghost_squid]: http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid
82[cmxt]: http://gaming.coolermaster.com/en/products/keyboards/quickfirext/
83
84
85
86License
87-------
88**GPLv2** or later. Some protocol files are under **Modified BSD License**.
89LUFA, PJRC and V-USB stack have their own license respectively.
90
91
92
93Build Firmware and Program Controller
94-------------------------------------
95See [doc/build.md](doc/build.md).
96
97
98
99Change your keymap
100------------------
101See [doc/keymap.md](doc/keymap.md).
102
103
104
105Magic Commands
106--------------
107To see help press `Magic` + `H`.
108
109 `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.
110
111Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
112
113 ----- Command Help -----
114 c: enter console mode
115 d: toggle debug enable
116 x: toggle matrix debug
117 k: toggle keyboard debug
118 m: toggle mouse debug
119 v: print device version & info
120 t: print timer count
121 s: print status
122 e: print eeprom config
123 n: toggle NKRO
124 0/F10: switch to Layer0
125 1/F1: switch to Layer1
126 2/F2: switch to Layer2
127 3/F3: switch to Layer3
128 4/F4: switch to Layer4
129 PScr: power down/remote wake-up
130 Caps: Lock Keyboard(Child Proof)
131 Paus: jump to bootloader
132
133**TBD**
134
135### Boot Magic Configuration - Virtual DIP Switch
136Boot Magic are executed during boot up time. Press Magic key below then plug in keyboard cable.
137Note 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.
138
139To avoid configuring accidentally additive salt key `KC_SPACE` also needs to be pressed along with the following configuration keys. The salt key is configurable in `config.h`. See [common/bootmagic.h](common/bootmagic.h).
140
141#### General
142- Skip reading EEPROM to start with default configuration(`ESC`)
143- Clear configuration stored in EEPROM to reset configuration(`Backspace`)
144
145#### Bootloader
146- Kick up Bootloader(`B`)
147
148#### Debug
149- Debug enable(`D`)
150- Debug matrix enable(`D`+`X`)
151- Debug keyboard enable(`D`+`K`)
152- Debug mouse enable(`D`+`M`)
153
154#### Keymap
155- Swap Control and CapsLock(`Left Control`)
156- Change CapsLock to Control(`Caps Lock`)
157- Swap LeftAlt and Gui(`Left Alt`)
158- Swap RightAlt and Gui(`Right Alt`)
159- Disable Gui(`Left Gui`)
160- Swap Grave and Escape(`Grave`)
161- Swap BackSlash and BackSpace(`Back Slash`)
162- Enable NKRO on boot(`N`)
163
164#### Default Layer
165- Set Default Layer to 0(`0`)
166- Set Default Layer to 1(`1`)
167- Set Default Layer to 2(`2`)
168- Set Default Layer to 3(`3`)
169- Set Default Layer to 4(`4`)
170- Set Default Layer to 5(`5`)
171- Set Default Layer to 6(`6`)
172- Set Default Layer to 7(`7`)
173
174#### Caution
175Unintentional use of this feature will cause user confusion.
176
177TODO: Magic key combination to avoid unintentional press during plug in
178
179**TBD**
180
181
182Mechanical Locking support
183--------------------------
184This feature makes it possible for you to use mechanical switch for `CapsLock`, `NumLock` or `ScrollLock`. To enable this feature define these macros in `config.h` and use `KC_LCAP`, `KC_LNUM` or `KC_LSCR` in keymap for locking key instead of normal `KC_CAPS`, `KC_NLCK` or `KC_SLCK`. Resync option tries to keep lock switch state consistent with keyboard LED state.
185
186 #define LOCKING_SUPPORT_ENABLE
187 #define LOCKING_RESYNC_ENABLE
188
189
190Start Your Own Project
191-----------------------
192**TBD**
193### Config.h Options
194#### 1. USB vendor/product ID and device description
195 #define VENDOR_ID 0xFEED
196 #define PRODUCT_ID 0xBEEF
197 #define MANUFACTURER t.m.k.
198 #define PRODUCT Macway mod
199 #define DESCRIPTION t.m.k. keyboard firmware for Macway mod
200
201#### 2. Keyboard matrix configuration
202 #define MATRIX_ROWS 8
203 #define MATRIX_COLS 8
204 #define MATRIX_HAS_GHOST
205
206
207
208Architecture
209------------
210 Architecture Diagram
211 +---------------+---------------+-------------+
212 | Host | Keyboard | Matrix, LED |
213 ___________ |-----------+-+ +-------------+ | +-----------|
214 / /| Keys/Mouse | Protocol |d| | Action | | | Protocol |
215 /__________/ |<-----------| LUFA |r| | Layer, Tap | | | Matrix |
216 |.--------.| | LED | V-USB |i| |-------------| | | PS/2,IBM | __________________
217 || || |----------->| PJRC |v| | Keymap | | | ADB,M0110| Keys / /_/_/_/_/_/_/_/ /|
218 || Host || | Console | iWRAP(BT)|e| | Mousekey | | | SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
219 ||________||/.<-----------| UART |r| | Report | | | X68K/PC98| Control / /_/_/_/_/_/_/_/ / /
220 `_========_'/| |---------------------------------------------|-------->/___ /_______/ ___/ /
221 |_o______o_|/ | Sendchar, Print, Debug, Command, ... | |_________________|/
222 +---------------------------------------------+ Keyboard
223
224
225
226Debugging
227--------
228Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack.
229
230You can use xprintf() to display debug info on `hid_listen`, see `common/xprintf.h`.
231
232
233
234Files and Directories
235-------------------
236### Top
237* common/ - common codes
238* protocol/ - keyboard protocol support
239* keyboard/ - keyboard projects
240* converter/ - protocol converter projects
241* doc/ - documents
242* common.mk - Makefile for common
243* protocol.mk - Makefile for protocol
244* rules.mk - Makefile for build rules
245
246### Common
247* host.h
248* host_driver.h
249* keyboard.h
250* command.h
251* keymap.h
252* action.h
253* keycode.h
254* matrix.h
255* led.h
256* mousekey.h
257* report.h
258* debug.h
259* print.h
260* bootloader.h
261* sendchar.h
262* timer.h
263* util.h
264
265### Keyboard Protocols
266* lufa/ - LUFA USB stack
267* pjrc/ - PJRC USB stack
268* vusb/ - Objective Development V-USB
269* iwrap/ - Bluetooth HID for Bluegiga iWRAP
270* ps2.c - PS/2 protocol
271* adb.c - Apple Desktop Bus protocol
272* m0110.c - Macintosh 128K/512K/Plus keyboard protocol
273* news.c - Sony NEWS keyboard protocol
274* x68k.c - Sharp X68000 keyboard protocol
275* serial_soft.c - Asynchronous Serial protocol implemented by software
276
277
278
279Coding Style
280-------------
281- Doesn't use Tab to indent, use 4-spaces instead.
282
283
284
285Other Keyboard Firmware Projects
286------------------
287See [doc/other_projects.md](doc/other_projects.md).
Imprint / Impressum