From 4ff2d2fc969b0d0c4a3c84b7a180d7ebcbcd2cef Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Mon, 2 Oct 2023 14:55:35 -0700 Subject: [PATCH] Add oryx keymap for voyager --- keyboards/voyager/keymaps/oryx/config.h | 16 +++ keyboards/voyager/keymaps/oryx/keymap.c | 161 ++++++++++++++++++++++++ keyboards/voyager/keymaps/oryx/rules.mk | 12 ++ 3 files changed, 189 insertions(+) create mode 100644 keyboards/voyager/keymaps/oryx/config.h create mode 100644 keyboards/voyager/keymaps/oryx/keymap.c create mode 100644 keyboards/voyager/keymaps/oryx/rules.mk diff --git a/keyboards/voyager/keymaps/oryx/config.h b/keyboards/voyager/keymaps/oryx/config.h new file mode 100644 index 000000000000..89c15788c38f --- /dev/null +++ b/keyboards/voyager/keymaps/oryx/config.h @@ -0,0 +1,16 @@ +/* + 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 +*/ + +#pragma once + +#define ORYX_CONFIGURATOR +#define FIRMWARE_VERSION u8"E5AmY/7jeEJ" +#define RAW_USAGE_PAGE 0xFF60 +#define RAW_USAGE_ID 0x61 +#define LAYER_STATE_8BIT + +#define RGB_MATRIX_STARTUP_SPD +#define PERMISSIVE_HOLD +#define QUICK_TAP_TERM_PER_KEY diff --git a/keyboards/voyager/keymaps/oryx/keymap.c b/keyboards/voyager/keymaps/oryx/keymap.c new file mode 100644 index 000000000000..dbe297d389e4 --- /dev/null +++ b/keyboards/voyager/keymaps/oryx/keymap.c @@ -0,0 +1,161 @@ +#include QMK_KEYBOARD_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_74_255_255, + HSV_169_255_255, +}; + + + +enum tap_dance_codes { + DANCE_0, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_voyager( + TD(DANCE_0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + CW_TOGG, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + MT(MOD_LSFT, KC_BSPC),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_QUOTE), + KC_LGUI, MT(MOD_LALT, KC_Z),KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, MT(MOD_RALT, KC_SLASH),KC_RCTL, + LT(1,KC_ENTER), MT(MOD_LCTL, KC_TAB), MT(MOD_LSFT, KC_BSPC),LT(2,KC_SPACE) + ), + [1] = LAYOUT_voyager( + KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_GRAVE, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_7, KC_8, KC_9, KC_MINUS, KC_SLASH, KC_F12, + KC_TRANSPARENT, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, KC_PLUS, KC_ASTR, KC_BSPC, + KC_TRANSPARENT, KC_TRANSPARENT, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, KC_DOT, KC_EQUAL, KC_ENTER, + KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_0 + ), + [2] = LAYOUT_voyager( + RGB_TOG, TOGGLE_LAYER_COLOR,RGB_MOD, RGB_SLD, RGB_VAD, RGB_VAI, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, + KC_TRANSPARENT, KC_TRANSPARENT, KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_AUDIO_MUTE, KC_TRANSPARENT, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_TRANSPARENT, KC_TRANSPARENT, + EE_CLR, KC_MEDIA_PREV_TRACK,KC_MEDIA_NEXT_TRACK,KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE,KC_TRANSPARENT, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRANSPARENT, KC_TRANSPARENT, + KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, HSV_0_255_255, HSV_74_255_255, HSV_169_255_255, KC_TRANSPARENT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, + KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT + ), +}; + + + + +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_74_255_255: + if (record->event.pressed) { + rgblight_mode(1); + rgblight_sethsv(74,255,255); + } + return false; + case HSV_169_255_255: + if (record->event.pressed) { + rgblight_mode(1); + rgblight_sethsv(169,255,255); + } + return false; + } + return true; +} + + +typedef struct { + bool is_press_action; + uint8_t step; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD, + DOUBLE_TAP, + DOUBLE_HOLD, + DOUBLE_SINGLE_TAP, + MORE_TAPS +}; + +static tap dance_state[1]; + +uint8_t dance_step(tap_dance_state_t *state); + +uint8_t dance_step(tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + return MORE_TAPS; +} + + +void on_dance_0(tap_dance_state_t *state, void *user_data); +void dance_0_finished(tap_dance_state_t *state, void *user_data); +void dance_0_reset(tap_dance_state_t *state, void *user_data); + +void on_dance_0(tap_dance_state_t *state, void *user_data) { + if(state->count == 3) { + tap_code16(KC_EQUAL); + tap_code16(KC_EQUAL); + tap_code16(KC_EQUAL); + } + if(state->count > 3) { + tap_code16(KC_EQUAL); + } +} + +void dance_0_finished(tap_dance_state_t *state, void *user_data) { + dance_state[0].step = dance_step(state); + switch (dance_state[0].step) { + case SINGLE_TAP: register_code16(KC_EQUAL); break; + case SINGLE_HOLD: register_code16(KC_ESCAPE); break; + case DOUBLE_TAP: register_code16(KC_EQUAL); register_code16(KC_EQUAL); break; + case DOUBLE_SINGLE_TAP: tap_code16(KC_EQUAL); register_code16(KC_EQUAL); + } +} + +void dance_0_reset(tap_dance_state_t *state, void *user_data) { + wait_ms(10); + switch (dance_state[0].step) { + case SINGLE_TAP: unregister_code16(KC_EQUAL); break; + case SINGLE_HOLD: unregister_code16(KC_ESCAPE); break; + case DOUBLE_TAP: unregister_code16(KC_EQUAL); break; + case DOUBLE_SINGLE_TAP: unregister_code16(KC_EQUAL); break; + } + dance_state[0].step = 0; +} + +tap_dance_action_t tap_dance_actions[] = { + [DANCE_0] = ACTION_TAP_DANCE_FN_ADVANCED(on_dance_0, dance_0_finished, dance_0_reset), +}; diff --git a/keyboards/voyager/keymaps/oryx/rules.mk b/keyboards/voyager/keymaps/oryx/rules.mk new file mode 100644 index 000000000000..f88b544be7cd --- /dev/null +++ b/keyboards/voyager/keymaps/oryx/rules.mk @@ -0,0 +1,12 @@ +# 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 +MOUSEKEY_ENABLE = no +ORYX_ENABLE = yes +RGB_MATRIX_CUSTOM_KB = yes +TAP_DANCE_ENABLE = yes +SPACE_CADET_ENABLE = no +CAPS_WORD_ENABLE = yes + +ACHORDION_ENABLE = yes