I’m brand new to this, and not a developer and looking for help configuring a rotary knob on a GMMK Pro to change Windows Desktops. The default key combination is Control-Windows-Left/Right Arrow. I’d like the rotary knob to take me to the right for clockwise turns and left desktop for counterclockwise.
I used the QMK CLI to get the rotary knob working as volume up / down before modifying and attempted to use the same syntax I used for a standard keymapping on rotary knob press (Control-Alt-Delete = RCTL(RALT(KC_DEL))). It doesn’t seem to like the nested KC options after the tap_code.
#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_LCTL(KC_LGUI(KC_RGHT)));
} else {
tap_code(KC_LCTL(KC_LGUI(KC_LEFT)));
}
return true;
}
#endif // ENCODER_ENABLE
Here are the compiler errors -
Compiling: keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.c In file included from quantum/action.h:23,
from quantum/keymap.h:22,
from quantum/quantum.h:21,
from keyboards/gmmk/pro/pro.h:19,
from keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.c:1:
keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.c: In function ‘encoder_update_user’:
quantum/keycode.h:175:17: error: called object is not a function or function pointer
175 | #define KC_LGUI KC_LEFT_GUI
| ^~~~~~~~~~~
keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.c:18:24: note: in expansion of macro ‘KC_LGUI’
18 | tap_code(KC_LCTL(KC_LGUI(KC_RGHT)));
| ^~~~~~~
quantum/keycode.h:171:17: error: called object is not a function or function pointer
171 | #define KC_LCTL KC_LEFT_CTRL
| ^~~~~~~~~~~~
keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.c:18:16: note: in expansion of macro ‘KC_LCTL’
18 | tap_code(KC_LCTL(KC_LGUI(KC_RGHT)));
| ^~~~~~~
quantum/keycode.h:175:17: error: called object is not a function or function pointer
175 | #define KC_LGUI KC_LEFT_GUI
| ^~~~~~~~~~~
keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.c:20:24: note: in expansion of macro ‘KC_LGUI’
20 | tap_code(KC_LCTL(KC_LGUI(KC_LEFT)));
| ^~~~~~~
quantum/keycode.h:171:17: error: called object is not a function or function pointer
171 | #define KC_LCTL KC_LEFT_CTRL
| ^~~~~~~~~~~~
keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.c:20:16: note: in expansion of macro ‘KC_LCTL’
20 | tap_code(KC_LCTL(KC_LGUI(KC_LEFT)));
| ^~~~~~~
[ERRORS]
|
|
|
make[1]: *** [tmk_core/rules.mk:457: .build/obj_gmmk_pro_ansi_nyko/keyboards/gmmk/pro/ansi/keymaps/nyko/keymap.o] Error 1
Make finished with errors
make: *** [Makefile:478: gmmk/pro/ansi:nyko] Error 1