diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-06-10 12:26:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-10 12:26:09 -0400 |
commit | 163754f363b4dd27f5433b251a9cce918106f02f (patch) | |
tree | d50bd374e3c7b287381ffca1d6a14af9201d61fc /docs | |
parent | ad49086be54f4299b16cb306ca21571a0bb81e3c (diff) | |
download | qmk_firmware-163754f363b4dd27f5433b251a9cce918106f02f.tar.gz |
Create Home.md
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Home.md | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/docs/Home.md b/docs/Home.md index bc1d25bf2..500712a22 100644 --- a/docs/Home.md +++ b/docs/Home.md @@ -132,52 +132,3 @@ case MACRO_RAISED: Enable the backlight from the Makefile. -# Custom Quantum functions - -All of these functions are available in the `*_kb()` or `*_user()` variety. `kb` ones should only be used in the `<keyboard>/<keyboard>.c` file, and `user` ones should only be used in the `keymap.c`. The keyboard ones call the user ones - it's necessary to keep these calls to allow the keymap functions to work correctly. - -## `void matrix_init_*(void)` - -This function gets called when the matrix is initiated, and can contain start-up code for your keyboard/keymap. - -## `void matrix_scan_*(void)` - -This function gets called at every matrix scan, which is basically as often as the MCU can handle. Be careful what you put here, as it will get run a lot. - -## `bool process_record_*(uint16_t keycode, keyrecord_t *record)` - -This function gets called on every keypress/release, and is where you can define custom functionality. The return value is whether or not QMK should continue processing the keycode - returning `false` stops the execution. - -The `keycode` variable is whatever is defined in your keymap, eg `MO(1)`, `KC_L`, etc. and can be switch-cased to execute code whenever a particular code is pressed. - -The `record` variable contains infomation about the actual press: - -``` -keyrecord_t record { - keyevent_t event { - keypos_t key { - uint8_t col - uint8_t row - } - bool pressed - uint16_t time - } -} -``` - -The conditional `if (record->event.pressed)` can tell if the key is being pressed or released, and you can execute code based on that. - -## `void led_set_*(uint8_t usb_led)` - -This gets called whenever there is a state change on your host LEDs \(eg caps lock, scroll lock, etc\). The LEDs are defined as: - -``` -#define USB_LED_NUM_LOCK 0 -#define USB_LED_CAPS_LOCK 1 -#define USB_LED_SCROLL_LOCK 2 -#define USB_LED_COMPOSE 3 -#define USB_LED_KANA 4 -``` - -and can be tested against the `usb_led` with a conditional like `if (usb_led & (1<<USB_LED_CAPS_LOCK))` - if this is true, you can turn your LED on, otherwise turn it off. - |