summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Hallsby <karl@hallsby.com>2021-12-25 22:06:57 -0600
committerKarl Hallsby <karl@hallsby.com>2021-12-25 22:06:57 -0600
commit742e11c80981f8b447b9c5e281b14bfd77f74cc9 (patch)
treeb945637301d323886f9ba6bbd425d5eb677a58e7
parent53e5cab5fb89c6c95f35c1bc56b9f05766b1a46c (diff)
Add first version of keyboard created
This first revision of the original flashed image is one that more slightly suits my needs, with more of the Emacs modifier keys being placed on the thumb-clusters, rather than scattered around. Currently, only Layer 0 is customized. None of the others have been changed.
-rw-r--r--config.h8
-rw-r--r--keymap.c155
-rw-r--r--rules.mk7
3 files changed, 170 insertions, 0 deletions
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..94ba3f3
--- /dev/null
+++ b/config.h
@@ -0,0 +1,8 @@
+/*
+ Set any config.h overrides for your specific keymap here.
+ See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file
+*/
+#define ORYX_CONFIGURATOR
+#define USB_SUSPEND_WAKEUP_DELAY 0
+#define FIRMWARE_VERSION u8"OYOoW/BpOqB"
+#define RGB_MATRIX_STARTUP_SPD 60
diff --git a/keymap.c b/keymap.c
new file mode 100644
index 0000000..7b419f9
--- /dev/null
+++ b/keymap.c
@@ -0,0 +1,155 @@
+#include QMK_KEYBOARD_H
+#include "version.h"
+#include "keymap_german.h"
+#include "keymap_nordic.h"
+#include "keymap_french.h"
+#include "keymap_spanish.h"
+#include "keymap_hungarian.h"
+#include "keymap_swedish.h"
+#include "keymap_br_abnt2.h"
+#include "keymap_canadian_multilingual.h"
+#include "keymap_german_ch.h"
+#include "keymap_jp.h"
+#include "keymap_korean.h"
+#include "keymap_bepo.h"
+#include "keymap_italian.h"
+#include "keymap_slovenian.h"
+#include "keymap_lithuanian_azerty.h"
+#include "keymap_danish.h"
+#include "keymap_norwegian.h"
+#include "keymap_portuguese.h"
+#include "keymap_contributions.h"
+#include "keymap_czech.h"
+#include "keymap_romanian.h"
+#include "keymap_russian.h"
+#include "keymap_uk.h"
+#include "keymap_estonian.h"
+#include "keymap_belgian.h"
+#include "keymap_us_international.h"
+
+#define KC_MAC_UNDO LGUI(KC_Z)
+#define KC_MAC_CUT LGUI(KC_X)
+#define KC_MAC_COPY LGUI(KC_C)
+#define KC_MAC_PASTE LGUI(KC_V)
+#define KC_PC_UNDO LCTL(KC_Z)
+#define KC_PC_CUT LCTL(KC_X)
+#define KC_PC_COPY LCTL(KC_C)
+#define KC_PC_PASTE LCTL(KC_V)
+#define ES_LESS_MAC KC_GRAVE
+#define ES_GRTR_MAC LSFT(KC_GRAVE)
+#define ES_BSLS_MAC ALGR(KC_6)
+#define NO_PIPE_ALT KC_GRAVE
+#define NO_BSLS_ALT KC_EQUAL
+#define LSA_T(kc) MT(MOD_LSFT | MOD_LALT, kc)
+#define BP_NDSH_MAC ALGR(KC_8)
+#define SE_SECT_MAC ALGR(KC_6)
+#define MOON_LED_LEVEL LED_LEVEL
+
+enum custom_keycodes {
+ RGB_SLD = ML_SAFE_RANGE,
+ HSV_0_255_255,
+ HSV_86_255_128,
+ HSV_172_255_255,
+};
+
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_moonlander(
+ KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_EQUAL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH,
+ KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(2,KC_SCOLON),MT(MOD_LGUI, KC_QUOTE),
+ KC_LSHIFT, MT(MOD_LCTL, KC_Z),KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, MT(MOD_RCTL, KC_SLASH),KC_RSHIFT,
+ LT(1,KC_GRAVE), WEBUSB_PAIR, LALT(KC_LSHIFT),KC_LEFT, KC_RIGHT, MT(MOD_LALT, KC_APPLICATION), MT(MOD_LCTL, KC_ESCAPE),KC_UP, KC_DOWN, KC_LBRACKET, KC_RBRACKET, MO(1),
+ KC_LCTRL, KC_BSPACE, KC_LGUI, KC_LALT, KC_ENTER, KC_SPACE
+ ),
+ [1] = LAYOUT_moonlander(
+ KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRANSPARENT, KC_TRANSPARENT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
+ KC_TRANSPARENT, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRANSPARENT, KC_TRANSPARENT, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
+ KC_TRANSPARENT, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE, KC_TRANSPARENT, KC_TRANSPARENT, KC_DOWN, KC_4, KC_5, KC_6, KC_KP_PLUS, KC_TRANSPARENT,
+ KC_TRANSPARENT, KC_PERC, KC_CIRC, KC_LBRACKET, KC_RBRACKET, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLASH, KC_TRANSPARENT,
+ KC_TRANSPARENT, KC_COMMA, HSV_0_255_255, HSV_86_255_128, HSV_172_255_255,RGB_MOD, RGB_TOG, KC_TRANSPARENT, KC_DOT, KC_0, KC_EQUAL, KC_TRANSPARENT,
+ RGB_VAD, RGB_VAI, TOGGLE_LAYER_COLOR, RGB_SLD, RGB_HUD, RGB_HUI
+ ),
+ [2] = LAYOUT_moonlander(
+ AU_TOG, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, RESET,
+ MU_TOG, KC_TRANSPARENT, KC_TRANSPARENT, KC_MS_UP, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
+ MU_MOD, KC_TRANSPARENT, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_MEDIA_PLAY_PAUSE,
+ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_MEDIA_PREV_TRACK,KC_MEDIA_NEXT_TRACK,KC_TRANSPARENT, KC_TRANSPARENT,
+ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_MS_BTN1, KC_MS_BTN2, KC_TRANSPARENT, KC_TRANSPARENT, KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE, KC_TRANSPARENT, KC_TRANSPARENT,
+ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_WWW_BACK
+ ),
+};
+
+extern bool g_suspend_state;
+extern rgb_config_t rgb_matrix_config;
+
+void keyboard_post_init_user(void) {
+ rgb_matrix_enable();
+}
+
+const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
+ [0] = { {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255}, {0,0,255} },
+
+};
+
+void set_layer_color(int layer) {
+ for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ HSV hsv = {
+ .h = pgm_read_byte(&ledmap[layer][i][0]),
+ .s = pgm_read_byte(&ledmap[layer][i][1]),
+ .v = pgm_read_byte(&ledmap[layer][i][2]),
+ };
+ if (!hsv.h && !hsv.s && !hsv.v) {
+ rgb_matrix_set_color( i, 0, 0, 0 );
+ } else {
+ RGB rgb = hsv_to_rgb( hsv );
+ float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX;
+ rgb_matrix_set_color( i, f * rgb.r, f * rgb.g, f * rgb.b );
+ }
+ }
+}
+
+void rgb_matrix_indicators_user(void) {
+ if (g_suspend_state || keyboard_config.disable_layer_led) { return; }
+ switch (biton32(layer_state)) {
+ case 0:
+ set_layer_color(0);
+ break;
+ default:
+ if (rgb_matrix_get_flags() == LED_FLAG_NONE)
+ rgb_matrix_set_color_all(0, 0, 0);
+ break;
+ }
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case RGB_SLD:
+ if (record->event.pressed) {
+ rgblight_mode(1);
+ }
+ return false;
+ case HSV_0_255_255:
+ if (record->event.pressed) {
+ rgblight_mode(1);
+ rgblight_sethsv(0,255,255);
+ }
+ return false;
+ case HSV_86_255_128:
+ if (record->event.pressed) {
+ rgblight_mode(1);
+ rgblight_sethsv(86,255,128);
+ }
+ return false;
+ case HSV_172_255_255:
+ if (record->event.pressed) {
+ rgblight_mode(1);
+ rgblight_sethsv(172,255,255);
+ }
+ return false;
+ }
+ return true;
+}
+
+
diff --git a/rules.mk b/rules.mk
new file mode 100644
index 0000000..078bd2f
--- /dev/null
+++ b/rules.mk
@@ -0,0 +1,7 @@
+# Set any rules.mk overrides for your specific keymap here.
+# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file
+CONSOLE_ENABLE = no
+COMMAND_ENABLE = no
+WEBUSB_ENABLE = yes
+ORYX_ENABLE = yes
+SRC = matrix.c