aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/Home.md49
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:
132 132
133Enable the backlight from the Makefile. 133Enable the backlight from the Makefile.
134 134
135# Custom Quantum functions
136
137All 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.
138
139## `void matrix_init_*(void)`
140
141This function gets called when the matrix is initiated, and can contain start-up code for your keyboard/keymap.
142
143## `void matrix_scan_*(void)`
144
145This 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.
146
147## `bool process_record_*(uint16_t keycode, keyrecord_t *record)`
148
149This 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.
150
151The `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.
152
153The `record` variable contains infomation about the actual press:
154
155```
156keyrecord_t record {
157 keyevent_t event {
158 keypos_t key {
159 uint8_t col
160 uint8_t row
161 }
162 bool pressed
163 uint16_t time
164 }
165}
166```
167
168The conditional `if (record->event.pressed)` can tell if the key is being pressed or released, and you can execute code based on that.
169
170## `void led_set_*(uint8_t usb_led)`
171
172This gets called whenever there is a state change on your host LEDs \(eg caps lock, scroll lock, etc\). The LEDs are defined as:
173
174```
175#define USB_LED_NUM_LOCK 0
176#define USB_LED_CAPS_LOCK 1
177#define USB_LED_SCROLL_LOCK 2
178#define USB_LED_COMPOSE 3
179#define USB_LED_KANA 4
180```
181
182and 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.
183