From 713ec91147aa56849f9e2ff93ee98ef1eb6eebc0 Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Mon, 1 Oct 2018 19:50:14 -0700 Subject: Add C hint to inline code --- docs/custom_quantum_functions.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index f8b84cd6b3..b077e4b78d 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -27,7 +27,7 @@ The first step to creating your own custom keycode(s) is to enumerate them. This Here is an example of enumerating 2 keycodes. After adding this block to your `keymap.c` you will be able to use `FOO` and `BAR` inside your keymap. -``` +```c enum my_keycodes { FOO = SAFE_RANGE, BAR @@ -44,7 +44,7 @@ These function are called every time a key is pressed or released. This example does two things. It defines the behavior for a custom keycode called `FOO`, and it supplements our Enter key by playing a tone whenever it is pressed. -``` +```c bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case FOO: @@ -75,16 +75,16 @@ The `keycode` argument is whatever is defined in your keymap, eg `MO(1)`, `KC_L` The `record` argument contains information about the actual press: -``` +```c keyrecord_t record { -+-keyevent_t event { -| +-keypos_t key { -| | +-uint8_t col -| | +-uint8_t row -| | } -| +-bool pressed -| +-uint16_t time -| } + keyevent_t event { + keypos_t key { + uint8_t col + uint8_t row + } + bool pressed + uint16_t time + } } ``` @@ -100,7 +100,7 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec. ### Example `led_set_user()` Implementation -``` +```c void led_set_user(uint8_t usb_led) { if (usb_led & (1<