aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorla-ninpre <aaoth@aaoth.xyz>2024-01-03 23:57:55 +0300
committerla-ninpre <aaoth@aaoth.xyz>2024-01-03 23:57:55 +0300
commit32eb37bc3e68a3cd0203b149d6de537346df2f1b (patch)
tree4f907a4824792b49c2d476fd624bfd333758e6d2
downloadqmk-userspace-32eb37bc3e68a3cd0203b149d6de537346df2f1b.tar.gz
qmk-userspace-32eb37bc3e68a3cd0203b149d6de537346df2f1b.zip
initial commit
-rw-r--r--README.md21
-rw-r--r--config.h24
-rw-r--r--keymap.c85
-rw-r--r--rules.mk9
4 files changed, 139 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d350e23
--- /dev/null
+++ b/README.md
@@ -0,0 +1,21 @@
+# keychron v1 ansi knobless qmk keymap
+
+my experiments with qmk.
+don't wanna go too advanced and exploring the world of customizable keyboards,
+while trying to figure out what i would think will be convenient for me.
+
+## 2023-01-03
+
+basic qwerty, f-row is used for switching workspaces in window managers
+(i use sway, hyprland and cwm, all of them are configured to use super+<n>
+for switching workspaces).
+
+hardware switch is repurposed for turining rgb on and off.
+
+most of rgb effects turned off, don't need them.
+just solid color (but it's a bit hard to get right).
+
+second layer contains f-keys and numpad.
+
+third layer contains some magick keys for entering bootloader mode,
+clearing eeprom and toggling nkro. need to hold space and del to reach it.
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..820ab13
--- /dev/null
+++ b/config.h
@@ -0,0 +1,24 @@
+/* override defaults */
+#undef ENABLE_RGB_MATRIX_BREATHING
+#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
+#undef ENABLE_RGB_MATRIX_CYCLE_ALL
+#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
+#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
+#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
+#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN
+#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
+#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
+#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL
+#undef ENABLE_RGB_MATRIX_DUAL_BEACON
+#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON
+#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
+#undef ENABLE_RGB_MATRIX_PIXEL_RAIN
+#undef RGB_MATRIX_KEYPRESSES
+#undef RGB_MATRIX_FRAMEBUFFER_EFFECTS
+
+/* set our defaults */
+#define RGB_MATRIX_DISABLE_KEYCODES
+#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR
+#define RGB_MATRIX_DEFAULT_HUE 0
+#define RGB_MATRIX_DEFAULT_SAT 154
+#define RGB_MATRIX_DEFAULT_VAL 127
diff --git a/keymap.c b/keymap.c
new file mode 100644
index 0000000..be09f34
--- /dev/null
+++ b/keymap.c
@@ -0,0 +1,85 @@
+/* Copyright 2023 la-ninpre <aaoth@aaoth.xyz> */
+
+#include QMK_KEYBOARD_H
+
+/* ideas:
+ * - figure out tap dance, may be useful
+ * - is nkro needed?
+ * - is spacebar ok to change layers? i thought it is the biggest button, so it'll be easier to use.
+ * - do i really need more than 6 ttys?
+ */
+
+// switch to tty on linux, TTY(1) => Ctrl+Alt+F1
+#define TTY(n) (LCA(KC_F1+(n)-1))
+
+enum {
+ BASE,
+ EXTR,
+ MGCK,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [BASE] = LAYOUT_ansi_82(
+ KC_ESC, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), KC_MPLY, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME,
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_END,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
+ KC_LCTL, KC_LGUI, KC_LALT, LT(EXTR,KC_SPC), KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
+ [EXTR] = LAYOUT_ansi_82(
+ _______, TTY(1), TTY(2), TTY(3), TTY(4), TTY(5), TTY(6), TTY(7), TTY(8), TTY(9), TTY(10), TTY(11), TTY(12), MO(MGCK), KC_PSCR,
+ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_PEQL, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PAST, _______, KC_NUM,
+ _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PSLS, _______, _______,
+ _______, _______, _______, _______, KC_P0, KC_PDOT, KC_APP, _______, _______, _______),
+ [MGCK] = LAYOUT_ansi_82(
+ QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ EE_CLR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
+};
+
+#ifdef RGB_MATRIX_ENABLE
+#ifdef DIP_SWITCH_ENABLE
+bool
+dip_switch_update_user(uint8_t index, bool active)
+{
+ if(index == 0){
+ if(active){
+ rgb_matrix_enable_noeeprom();
+ } else {
+ rgb_matrix_disable_noeeprom();
+ }
+ }
+ return false;
+}
+#endif // DIP_SWITCH_ENABLE
+
+// top-right key for numpad status
+#define IND_NUMPAD 14
+#define IND_CAPSLK 45
+#define IND_R 0xcc
+#define IND_G 0x33
+#define IND_B 0x33
+bool
+rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max)
+{
+ if(rgb_matrix_is_enabled()){
+ led_t led_state = host_keyboard_led_state();
+ if(led_state.num_lock){
+ rgb_matrix_set_color(IND_NUMPAD, IND_R, IND_G, IND_G);
+ }else{
+ rgb_matrix_set_color(IND_NUMPAD, 0, 0, 0);
+ }
+ if(led_state.caps_lock){
+ rgb_matrix_set_color(IND_CAPSLK, IND_R, IND_G, IND_G);
+ }else{
+ rgb_matrix_set_color(IND_CAPSLK, 0, 0, 0);
+ }
+ }
+ return false;
+}
+#endif // RGB_MATRIX_ENABLE
diff --git a/rules.mk b/rules.mk
new file mode 100644
index 0000000..2672e9d
--- /dev/null
+++ b/rules.mk
@@ -0,0 +1,9 @@
+DIPSWITCH_ENABLE = yes
+RGB_MATRIX_ENABLE = yes
+
+# optimizations
+LTO_ENABLE = yes
+MOUSEKEY_ENABLE = no
+SPACE_CADET_ENABLE = no
+GRAVE_ESC_ENABLE = no
+SEND_STRING_ENABLE = no