diff options
author | Nick Brassel <nick@tzarc.org> | 2025-02-28 09:23:04 +1100 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2025-02-28 09:23:04 +1100 |
commit | a63fd7f01cdabd9ce85bb09ae2b573fd3b8e60aa (patch) | |
tree | 35d817580e5244d62a150a2d012f72906a610977 /keyboards/cxt_studio/12e4/cxt_studio.c | |
parent | 6d0e5728aa61b442885d48caf49d29e5c60e8197 (diff) | |
parent | cdb865cf60b17593f5c811c24a21d7b3030d8653 (diff) |
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'keyboards/cxt_studio/12e4/cxt_studio.c')
-rw-r--r-- | keyboards/cxt_studio/12e4/cxt_studio.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/keyboards/cxt_studio/12e4/cxt_studio.c b/keyboards/cxt_studio/12e4/cxt_studio.c new file mode 100644 index 0000000000..03a15e4d48 --- /dev/null +++ b/keyboards/cxt_studio/12e4/cxt_studio.c @@ -0,0 +1,47 @@ +// Copyright 2023 Colin Kinloch (@ColinKinloch) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } + switch (index) { + case 0: { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } + break; + case 1: { + if (clockwise) { + rgb_matrix_increase_hue(); + } else { + rgb_matrix_decrease_hue(); + } + } + break; + case 2: { + if (clockwise) { + rgb_matrix_increase_val(); + } else { + rgb_matrix_decrease_val(); + } + } + break; + case 3: { + if (clockwise) { + rgb_matrix_step(); + } else { + rgb_matrix_step_reverse(); + } + } + break; + } + return true; +} +#endif |