summaryrefslogtreecommitdiff
path: root/keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c
diff options
context:
space:
mode:
authorGrayson Carr <734415+gtg465x@users.noreply.github.com>2021-10-06 11:36:04 -0400
committerGitHub <noreply@github.com>2021-10-06 08:36:04 -0700
commitd5fae3a6f96d44a432350d5f487204a962c5f9bc (patch)
treec6bb3798b8150714cc53171ba7f091583252a85b /keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c
parentf32db0bdd1f25099605ed324f1e8eab9aa7361e4 (diff)
Updated Keychron Q1 user keymap (#14666)
* Updated Keychron Q1 user keymap - Added Caps Lock indicator - Mission Control and Launchpad custom keycodes are now defined using the VIA user keycodes range so they can be labeled properly in VIA * Only use VIA keycode range if VIA is enabled * Reformatted led_indexes enum to match layout * Feature: When the Fn layer is active, RGB lighting turns off for keys that are not assigned * Fixes * Cleanup: Updated method signature of rgb_matrix_set_color_by_keycode to more closely match rgb_matrix_set_color * Fixed int sizing for keycodes
Diffstat (limited to 'keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c')
-rw-r--r--keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c b/keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c
index 79ef0bf86b..7f806f6b45 100644
--- a/keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c
+++ b/keyboards/keychron/q1/rev_0100/keymaps/gtg465x/keymap.c
@@ -15,18 +15,20 @@
*/
#include QMK_KEYBOARD_H
+#include "keymap_user.h"
+#ifdef RGB_MATRIX_ENABLE
+# include "rgb_matrix_user.h"
+#endif
-
-enum layers{
- MAC_BASE,
- MAC_FN,
- WIN_BASE,
- WIN_FN
-};
+// clang-format off
enum custom_keycodes {
- KC_MISSION_CONTROL = SAFE_RANGE,
- KC_LAUNCHPAD
+#ifdef VIA_ENABLE
+ KC_MISSION_CONTROL = USER00,
+#else
+ KC_MISSION_CONTROL = SAFE_RANGE,
+#endif
+ KC_LAUNCHPAD
};
#define KC_MCTL KC_MISSION_CONTROL
@@ -70,6 +72,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
+// clang-format on
+
+void matrix_init_user(void) {
+#ifdef RGB_MATRIX_ENABLE
+ rgb_matrix_init_user();
+#endif
+}
+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MISSION_CONTROL: