Mercurial > louis > kiibohd-controller
comparison README.markdown @ 309:4f47971c45c2
Merge remote-tracking branch 'upstream/master'
author | Rowan Decker <Smasher816@gmail.com> |
---|---|
date | Sun, 08 Mar 2015 20:17:39 -0700 |
parents | ab4515606277 b311f387c921 |
children | a2df35fa4f0b |
comparison
equal
deleted
inserted
replaced
308:ab4515606277 | 309:4f47971c45c2 |
---|---|
7 Teensy 3.0/3.1, McHCK). | 7 Teensy 3.0/3.1, McHCK). |
8 | 8 |
9 Linux is the ideal build environment (preferably recent'ish). In the near | 9 Linux is the ideal build environment (preferably recent'ish). In the near |
10 future I'll make available an Arch Linux VM for building/manufacturing tests. | 10 future I'll make available an Arch Linux VM for building/manufacturing tests. |
11 | 11 |
12 Building on Mac should be ok for 99% of users with Macports (haven't tried | 12 Building on Mac should be ok for 99% of users with Macports or Homebrew. For |
13 Brew). The dfu Bootloader will not build correctly with the old version of | 13 Homebrew, use `brew tap PX4/homebrew-px4` to get the arm-none-eabi-gcc installer. |
14 The dfu Bootloader will not build correctly with the old version of | |
14 arm-none-eabi-gcc that Macports currently has (4.7.3). This is due to a bug | 15 arm-none-eabi-gcc that Macports currently has (4.7.3). This is due to a bug |
15 with lto (link time optimizations) which makes the resulting binary too big to | 16 with lto (link time optimizations) which makes the resulting binary too big to |
16 fit on the chip (must be less than 4096 Bytes). | 17 fit on the chip (must be less than 4096 Bytes). |
17 | 18 |
18 Building on Windows should also be fine for 99% of users, but takes a bunch of | 19 Building on Windows should also be fine for 99% of users, but takes a bunch of |
56 | 57 |
57 ARM Specific (Teensy 3.0/3.1, Infinity Keyboard, McHCK) | 58 ARM Specific (Teensy 3.0/3.1, Infinity Keyboard, McHCK) |
58 | 59 |
59 - Arch Linux / Mac Ports | 60 - Arch Linux / Mac Ports |
60 - arm-none-eabi-gcc | 61 - arm-none-eabi-gcc |
61 - arm-none-eaby-binutils | 62 - arm-none-eabi-binutils |
62 | 63 |
63 - Windows (https://launchpad.net/gcc-arm-embedded/+download) | 64 - Windows (https://launchpad.net/gcc-arm-embedded/+download) |
64 - gcc-arm-none-eabi (win32.zip) | 65 - gcc-arm-none-eabi (win32.zip) |
65 | 66 |
66 | 67 |
258 chip/architecture dependency checking but some permutations of modules may not | 259 chip/architecture dependency checking but some permutations of modules may not |
259 be tested/compile. | 260 be tested/compile. |
260 | 261 |
261 There are also CMake options for temporarily selecting modules. But it's | 262 There are also CMake options for temporarily selecting modules. But it's |
262 easier to just edit the file. e.g. `cmake -DScanModuleOverride=<module name>`. | 263 easier to just edit the file. e.g. `cmake -DScanModuleOverride=<module name>`. |
264 | |
265 | |
266 Keymap Configuration | |
267 -------------------- | |
268 | |
269 This is where you define the layout for your keyboard. | |
270 Currently, the only way to define kebyoard layouts is using [KLL](https://www.overleaf.com/read/zzqbdwqjfwwf). | |
271 | |
272 KLL is built up of 3 different kinds of keymaps in total. | |
273 The BaseMap, DefaultMap and PartialMaps. | |
274 | |
275 For each type of keymap, it is possible to combine multiple .kll files together to create new ones using | |
276 the compiler. The order of the files matter, as the right-most file will overwrite any setting in the | |
277 previous files. | |
278 | |
279 > NOTE: Each keymap is done after the entire file is processed. This means that within the file the order | |
280 > of assignment doesa *not* matter (if you assign the same thing twice, then yes the most recent one | |
281 > takes priority). | |
282 | |
283 | |
284 BaseMap defines what the keyboard can do. This includes specific capabilities of the keyboard (such as USB), | |
285 the mapping of Scan Codes to USB Codes and any specific configurations for the keyboard. | |
286 In general, the BaseMap rarely needs to be changed. Usually only when adding a new keyboard to the firmware | |
287 does the Basemap need any modification. | |
288 The BaseMap is what both DefaultMap and PartialMaps are based upon. This allows for a common reference | |
289 when defining custom keymappings. | |
290 | |
291 > NOTE: Don't use defaultMap.kll to change your layouts. This will work, but they will not be portable. | |
292 | |
293 | |
294 The DefaultMap is the normal state of the keyboard, i.e. your default layer. | |
295 Using the BaseMap as a base, the DefaultMap is a modification of the BaseMap to what the keyboard should do. | |
296 Since the DefaultMap uses USB Code to USB Code translations, this means that keymaps used for one keyboard | |
297 will work with another keyboard. | |
298 For example, I use Colemak, so this means I only have to define Colemak once for every keyboard that supports | |
299 the kiibohd firmware. This is possible because every BaseMap defines the keyboard as a US ANSI like keyboard | |
300 layout. | |
301 The DefaultMap can also be thought of as Layer 0. | |
302 | |
303 | |
304 PartialMaps are optional keymaps that can be "stacked" on top of the DefaultMap. | |
305 They can be dynamically swapped out using the layer control capabilities: | |
306 | |
307 - layerLatch( `<layer number>` ) | |
308 - layerLock( `<layer number>` ) | |
309 - layerShift( `<layer number>` ) | |
310 | |
311 layerShift is usually what you want as it works just like a standard shift key. | |
312 layerLock is similar to the CapsLock key. While layerLatch is a latch, where only the next key you press | |
313 will use that layer (e.g. stickykeys). | |
314 | |
315 A unique aspect of KLL layers is that it's a true stack of layers. | |
316 When a layer is activated, only the keys that are specified by the layer will change. | |
317 This means, if you define a layer that only sets `CapsLock -> LCtrl` and `LCtrl->Capslock` only those keys | |
318 will change when you active the layer. All the other keys will use the layer that is "underneath" to | |
319 lookup the keypress (usually the DefaultMap). | |
320 | |
321 This means that you can combine .kll files statically using the compiler or dynamically using the firmware. | |
322 | |
323 You can set the max number of layers by changing the `stateWordSize` define in one of your kll files. | |
324 By default it is set to 8 in Macro/PartialMap/capabilities.kll. This means you can have up to 256 layers | |
325 total (this includes the DefaultMap). | |
326 You can increase this number to either 16 or 32 (this will use more Flash and RAM btw) which will give you | |
327 2^16 and 2^32 possible layers respectively (65 535 and 4 294 967 295). | |
328 | |
329 | |
330 ```cmake | |
331 ### | |
332 # Keymap Configuration (do not include the .kll extension) | |
333 # | |
334 | |
335 #| Do not include the .kll extension | |
336 #| * BaseMap maps the native keyboard scan codes to USB Codes so the layout is compatible with all other layouts | |
337 #| * DefaultMap allows the default keymap to be modified from the BaseMap | |
338 #| * PartialMaps is a set of dynamically set layers (there is no limit, but too many may use up too much RAM...) | |
339 #| BaseMap generally does not need to be changed from "defaultMap" | |
340 #| | |
341 #| Syntax: | |
342 #| myMap | |
343 #| * defines a single .kll layout file, double-quotes are needed to distinguish between layers | |
344 #| "myMap specialLayer" | |
345 #| * defines myMap to be the main layout, then replace specialLayers on top of it | |
346 #| | |
347 #| - Only for PartialMaps - | |
348 #| "myMap specialLayer" "myMap colemak" dvorak | |
349 #| * As before, but also generates a second layer at index 2 and third at index 3 | |
350 #| | |
351 #| NOTE: Remember to add key(s) to enable each Partial Layer | |
352 #| NOTE2: Layers are always based up the BaseMap (which should be an ANSI-like mapping) | |
353 #| NOTE3: Compiler looks in kll/layouts and the build directory for layout files (precedence on build directory) | |
354 | |
355 ##| Set the base keyboard .kll map, defaults to "defaultMap" if not found | |
356 ##| Looks in Scan/<Module Name> for the available BaseMaps | |
357 set( BaseMap "defaultMap" | |
358 CACHE STRING "KLL BaseMap/Scancode Keymapping" ) | |
359 | |
360 ##| Layer additonal .kll maps on the BaseMap, layers are in order from 1st to nth | |
361 ##| Can be set to "" | |
362 set( DefaultMap "md1Overlay stdFuncMap" | |
363 CACHE STRING "KLL DefaultMap" ) | |
364 | |
365 ##| ParitalMaps available on top of the BaseMap. See above for syntax on specifying multiple layers vs. layering | |
366 ##| Can be set to "" | |
367 set( PartialMaps "hhkbpro2" | |
368 CACHE STRING "KLL PartialMaps/Layer Definitions" ) | |
369 ``` | |
263 | 370 |
264 | 371 |
265 Linux Building | 372 Linux Building |
266 -------------- | 373 -------------- |
267 | 374 |