summaryrefslogtreecommitdiff
path: root/keyboards/dmqdesign
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-05-21 23:17:32 -0700
committerGitHub <noreply@github.com>2021-05-21 23:17:32 -0700
commita0fed0ea176d1c986e40fc4981b900509c90d66e (patch)
treeee12f5943046015ea0dce8e2a30a68bc8eb99dbe /keyboards/dmqdesign
parent76c23b15abc824f867b48d8d5100dced2417d336 (diff)
Convert Encoder callbacks to be boolean functions (#12805)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'keyboards/dmqdesign')
-rw-r--r--keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c3
-rw-r--r--keyboards/dmqdesign/spin/keymaps/default/keymap.c7
-rw-r--r--keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c3
-rw-r--r--keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c3
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c15
-rw-r--r--keyboards/dmqdesign/spin/keymaps/via/keymap.c9
6 files changed, 23 insertions, 17 deletions
diff --git a/keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c b/keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c
index 6e0911da53..d6653691bb 100644
--- a/keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c
+++ b/keyboards/dmqdesign/spin/keymaps/codecoffeecode/keymap.c
@@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
switch(index) {
case 0:
if (clockwise) {
@@ -48,4 +48,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}
+ return true;
}
diff --git a/keyboards/dmqdesign/spin/keymaps/default/keymap.c b/keyboards/dmqdesign/spin/keymaps/default/keymap.c
index 0b5e6bd0b9..ea6b518c38 100644
--- a/keyboards/dmqdesign/spin/keymaps/default/keymap.c
+++ b/keyboards/dmqdesign/spin/keymaps/default/keymap.c
@@ -24,24 +24,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
rgblight_increase_hue(); //Cycle through the RGB hue
} else {
rgblight_decrease_hue();
}
- } else if (index == 1) { /* Second encoder */
+ } else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_VOLU); //Example of using tap_code which lets you use keycodes outside of the keymap
} else {
tap_code(KC_VOLD);
}
- } else if (index == 2) { /* Third encoder */
+ } else if (index == 2) { /* Third encoder */
if (clockwise) {
rgblight_increase_val(); //Change brightness on the RGB LEDs
} else {
rgblight_decrease_val();
}
}
+ return true;
}
diff --git a/keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c b/keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c
index cb2a21f557..100f821a60 100644
--- a/keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c
+++ b/keyboards/dmqdesign/spin/keymaps/encoderlayers/keymap.c
@@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
switch (currentLayer) { //break each encoder update into a switch statement for the current layer
case _BL:
@@ -124,6 +124,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break;
}
}
+ return true;
}
layer_state_t layer_state_set_user(layer_state_t state) { //This will run every time the layer is updated
diff --git a/keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c b/keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c
index b9ad17386c..4760011da5 100644
--- a/keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c
+++ b/keyboards/dmqdesign/spin/keymaps/gorbachev/keymap.c
@@ -61,7 +61,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
};
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
switch (get_highest_layer(layer_state)) { //break each encoder update into a switch statement for the current layer
case _NUMPAD:
@@ -135,6 +135,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break;
}
}
+ return true;
}
layer_state_t layer_state_set_user(layer_state_t state) { //This will run every time the layer is updated
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c
index ba3aa96d49..bdf5dff0df 100644
--- a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c
+++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c
@@ -37,8 +37,8 @@ enum custom_keycodes {
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MACRO] = LAYOUT(
- A(S(KC_N)), HELLO, CH_SUSP, TO(_MACRO),
- KC_MPRV, KC_MPLY, KC_MNXT, TO(_NUMPAD),
+ A(S(KC_N)), HELLO, CH_SUSP, TO(_MACRO),
+ KC_MPRV, KC_MPLY, KC_MNXT, TO(_NUMPAD),
C(A(KC_COMM)), KC_F5, C(A(KC_DOT)), TO(_RGB),
MO(_FN), CH_ASST, CH_CPNL),
@@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_NO, KC_NO, KC_NO, KC_TRNS,
KC_NO, KC_NO, KC_NO),
};
-// clang-format on
+// clang-format on
typedef enum layer_ack {
ACK_NO = 0,
@@ -79,20 +79,20 @@ const rgblight_segment_t PROGMEM _no_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, H
const rgblight_segment_t PROGMEM _yes_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_GREEN});
const rgblight_segment_t PROGMEM _meh_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 3, HSV_YELLOW});
-// clang-format on
+// clang-format on
const rgblight_segment_t *const PROGMEM _rgb_layers[] = {
[LAYER_OFFSET + 0] = _macro_layer,
[LAYER_OFFSET + 1] = _numpad_layer,
[LAYER_OFFSET + 2] = _rgb_layer,
[LAYER_OFFSET + 3] = _fn_layer,
-
+
[ACK_OFFSET + ACK_NO] = _no_layer,
[ACK_OFFSET + ACK_YES] = _yes_layer,
[ACK_OFFSET + ACK_MEH] = _meh_layer,
[ACK_OFFSET + ACK_MEH + 1] = NULL
};
-// clang-format off
+// clang-format off
const uint8_t PROGMEM _n_rgb_layers = sizeof(_rgb_layers) / sizeof(_rgb_layers[0]) - 1;
@@ -200,7 +200,7 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
}
}
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
switch (get_highest_layer(layer_state)) {
case _RGB:
if (index == 0) {
@@ -234,4 +234,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}
+ return true;
}
diff --git a/keyboards/dmqdesign/spin/keymaps/via/keymap.c b/keyboards/dmqdesign/spin/keymaps/via/keymap.c
index c3b5ef2603..6527cc8fd8 100644
--- a/keyboards/dmqdesign/spin/keymaps/via/keymap.c
+++ b/keyboards/dmqdesign/spin/keymaps/via/keymap.c
@@ -45,24 +45,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
rgblight_increase_hue(); //Cycle through the RGB hue
} else {
rgblight_decrease_hue();
}
- } else if (index == 1) { /* Second encoder */
+ } else if (index == 1) { /* Second encoder */
if (clockwise) {
rgblight_increase_sat();
} else {
rgblight_decrease_sat();
}
- } else if (index == 2) { /* Third encoder */
+ } else if (index == 2) { /* Third encoder */
if (clockwise) {
rgblight_increase_val(); //Change brightness on the RGB LEDs
} else {
rgblight_decrease_val();
}
}
-} \ No newline at end of file
+ return true;
+}