aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md46
1 files changed, 43 insertions, 3 deletions
diff --git a/readme.md b/readme.md
index a7320202b..d5a259ccb 100644
--- a/readme.md
+++ b/readme.md
@@ -140,6 +140,9 @@ If this is a bit complex for you, Docker might be the turn-key solution you need
140 140
141docker run -e keymap=gwen -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware 141docker run -e keymap=gwen -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware
142 142
143# On windows docker seems to have issue with VOLUME tag in Dockerfile, and $('pwd') won't print a windows compliant path, use full path instead like this
144docker run -e keymap=default -e keyboard=ergobop --rm -v D:/Users/Sacapuces/Documents/Repositories/qmk:/qmk:rw edasque/qmk_firmware
145
143``` 146```
144 147
145This will compile the targetted keyboard/keymap and leave it in your QMK directory for you to flash. 148This will compile the targetted keyboard/keymap and leave it in your QMK directory for you to flash.
@@ -320,6 +323,18 @@ This enables MIDI sending and receiving with your keyboard. To enter MIDI send m
320 323
321This allows you to send unicode symbols via `UC(<unicode>)` in your keymap. Only codes up to 0x7FFF are currently supported. 324This allows you to send unicode symbols via `UC(<unicode>)` in your keymap. Only codes up to 0x7FFF are currently supported.
322 325
326`UNICODEMAP_ENABLE`
327
328This allows sending unicode symbols using `X(<unicode>)` in your keymap. Codes
329up to 0xFFFFFFFF are supported, including emojis. You will need to maintain
330a separate mapping table in your keymap file.
331
332Known limitations:
333- Under Mac OS, only codes up to 0xFFFF are supported.
334- Under Linux ibus, only codes up to 0xFFFFF are supported (but anything important is still under this limit for now).
335
336Characters out of range supported by the OS will be ignored.
337
323`BLUETOOTH_ENABLE` 338`BLUETOOTH_ENABLE`
324 339
325This allows you to interface with a Bluefruit EZ-key to send keycodes wirelessly. It uses the D2 and D3 pins. 340This allows you to interface with a Bluefruit EZ-key to send keycodes wirelessly. It uses the D2 and D3 pins.
@@ -328,6 +343,10 @@ This allows you to interface with a Bluefruit EZ-key to send keycodes wirelessly
328 343
329This allows you output audio on the C6 pin (needs abstracting). See the [audio section](#driving-a-speaker---audio-support) for more information. 344This allows you output audio on the C6 pin (needs abstracting). See the [audio section](#driving-a-speaker---audio-support) for more information.
330 345
346`VARIABLE_TRACE`
347
348Use this to debug changes to variable values, see the [tracing variables](#tracing-variables) section for more information.
349
331### Customizing Makefile options on a per-keymap basis 350### Customizing Makefile options on a per-keymap basis
332 351
333If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard. 352If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard.
@@ -376,6 +395,8 @@ Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` -
376 395
377`TG(layer)` - toggles a layer on or off. As with `MO()`, you should set this key as `KC_TRNS` in the destination layer so that tapping it again actually toggles back to the original layer. Only works upwards in the layer stack. 396`TG(layer)` - toggles a layer on or off. As with `MO()`, you should set this key as `KC_TRNS` in the destination layer so that tapping it again actually toggles back to the original layer. Only works upwards in the layer stack.
378 397
398`TO(layer)` - Goes to a layer. This code is special, because it lets you go either up or down the stack -- just goes directly to the layer you want. So while other codes only let you go _up_ the stack (from layer 0 to layer 3, for example), `TO(2)` is going to get you to layer 2, no matter where you activate it from -- even if you're currently on layer 5. This gets activated on keydown (as soon as the key is pressed).
399
379 400
380### Fun with modifier keys 401### Fun with modifier keys
381 402
@@ -823,7 +844,7 @@ And then, to assign this macro to a key on your keyboard layout, you just use `M
823 844
824## Dynamic macros: record and replay macros in runtime 845## Dynamic macros: record and replay macros in runtime
825 846
826In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 128 keypresses. 847In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 64 keypresses (by default).
827 848
828To enable them, first add a new element to the `planck_keycodes` enum -- `DYNAMIC_MACRO_RANGE`: 849To enable them, first add a new element to the `planck_keycodes` enum -- `DYNAMIC_MACRO_RANGE`:
829 850
@@ -864,7 +885,7 @@ Add the following code to the very beginning of your `process_record_user()` fun
864 885
865To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `_DYN` layer button. The handler awaits specifically for the `MO(_DYN)` keycode as the "stop signal" so please don't use any fancy ways to access this layer, use the regular `MO()` modifier. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`. 886To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `_DYN` layer button. The handler awaits specifically for the `MO(_DYN)` keycode as the "stop signal" so please don't use any fancy ways to access this layer, use the regular `MO()` modifier. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
866 887
867If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 256; please read the comments for it in the header). 888If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
868 889
869For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header. 890For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
870 891
@@ -889,7 +910,7 @@ In `quantum/keymap_extras/`, you'll see various language files - these work the
889 910
890## Unicode support 911## Unicode support
891 912
892You can currently send 4 hex digits with your OS-specific modifier key (RALT for OSX with the "Unicode Hex Input" layout) - this is currently limited to supporting one OS at a time, and requires a recompile for switching. 8 digit hex codes are being worked on. The keycode function is `UC(n)`, where *n* is a 4 digit hexidecimal. Enable from the Makefile. 913You can currently send 4 hex digits with your OS-specific modifier key (RALT for OSX with the "Unicode Hex Input" layout, see [this article](http://www.poynton.com/notes/misc/mac-unicode-hex-input.html) to learn more) - this is currently limited to supporting one OS at a time, and requires a recompile for switching. 8 digit hex codes are being worked on. The keycode function is `UC(n)`, where *n* is a 4 digit hexidecimal. Enable from the Makefile.
893 914
894## Backlight Breathing 915## Backlight Breathing
895 916
@@ -1266,3 +1287,22 @@ If there are problems with the tests, you can find the executable in the `./buil
1266It's not yet possible to do a full integration test, where you would compile the whole firmware and define a keymap that you are going to test. However there are plans for doing that, because writing tests that way would probably be easier, at least for people that are not used to unit testing. 1287It's not yet possible to do a full integration test, where you would compile the whole firmware and define a keymap that you are going to test. However there are plans for doing that, because writing tests that way would probably be easier, at least for people that are not used to unit testing.
1267 1288
1268In that model you would emulate the input, and expect a certain output from the emulated keyboard. 1289In that model you would emulate the input, and expect a certain output from the emulated keyboard.
1290
1291# Tracing variables
1292
1293Sometimes you might wonder why a variable gets changed and where, and this can be quite tricky to track down without having a debugger. It's of course possible to manually add print statements to track it, but you can also enable the variable trace feature. This works for both for variables that are changed by the code, and when the variable is changed by some memory corruption.
1294
1295To take the feature into use add `VARIABLE_TRACE=x` to the end of you make command. `x` represents the number of variables you want to trace, which is usually 1.
1296
1297Then at a suitable place in the code, call `ADD_TRACED_VARIABLE`, to begin the tracing. For example to trace all the layer changes, you can do this
1298```c
1299void matrix_init_user(void) {
1300 ADD_TRACED_VARIABLE("layer", &layer_state, sizeof(layer_state));
1301}
1302```
1303
1304This will add a traced variable named "layer" (the name is just for your information), which tracks the memory location of `layer_state`. It tracks 4 bytes (the size of `layer_state`), so any modification to the variable will be reported. By default you can not specify a size bigger than 4, but you can change it by adding `MAX_VARIABLE_TRACE_SIZE=x` to the end of the make command line.
1305
1306In order to actually detect changes to the variables you should call `VERIFY_TRACED_VARIABLES` around the code that you think that modifies the variable. If a variable is modified it will tell you between which two `VERIFY_TRACED_VARIABLES` calls the modification happened. You can then add more calls to track it down further. I don't recommend spamming the codebase with calls. It's better to start with a few, and then keep adding them in a binary search fashion. You can also delete the ones you don't need, as each call need to store the file name and line number in the ROM, so you can run out of memory if you add too many calls.
1307
1308Also remember to delete all the tracing code ones you have found the bug, as you wouldn't want to create a pull request with tracing code. \ No newline at end of file