From 258954dc3e884dfa9a057f10f96c4544737e9e81 Mon Sep 17 00:00:00 2001 From: Jarrett Drouillard Date: Wed, 30 May 2018 17:49:20 -0400 Subject: [PATCH] Add kuatsure map to preonic board (#3087) * preonic-keymap: kuatsure keymap * preonic-kuatsure: move arrows and braces and stuffs * preonic-kuatsure: give more time for leader * preonic-kuatsure: move _ to lower o * preonic-kuatsure: tap dance space to enter * preonic-kuatsure: move vol buttons around conflicted with kaleidoscope file navigation * preonic-kuatsure: lower+spc = esc * preonic-kuatsure: add lock key & remove led stuff * preonic-kuatsure: little bit of tmux leadering * preonic-kuatsure: remove colemak and dvorak * preonic-kuatsure: remove lock key and tap dance * preonic-kuatsure: lower space -> enter -- raise space -> esc * preonice-kuatsure: move tmux stuff to homerow keys * preonic-kuatsure: set tmux prefix to a function * preonic-kuatsure: hello game layers * preonic-kuatsure: instead of zelda, ffvii for game mode :) * preonic-kuatsure: mild changes after playing games to game modes * preonice-kuatsure: omg comma dangles and spaces in switch! * preonic-kuatsure: kinda make lower a shift on special characters * preonic-kuatsure: I don't use these * preonic-kuatsure: move vol- to the begining of media row * preonic-kuatsure: more tmux leader stuff ( pane 3 & last pane ) * preonic-kuatsure: abstract out tmux pane zooming * preonic-kuatsure: abstract pane switch * preonic-kuatsure: game_mod is carries over lower positions starting to wonder if I need game_mod ... lol * preonic-kuatsure: switch lwr/rse esc / ent * preonic-kuatsure: add leaders for window switching * preonic-kuatsure: major pruning of adjust layer * preonic-kuatsure: major rework on raise layer * preonic-kuatsure: game mods f layer is raise now * user-kuatsure: hello * various-kuatsure: use layout format + globalize querty / number keys * preonic-kuatsure: don't use tap dance anymore * various-kuatsure: code formatting * various-kuatsure: add function layer vars * preonic-kuatsure: moar formatting * preonic-kuatsure: add home / end keys --- keyboards/preonic/keymaps/kuatsure/config.h | 43 ++++ keyboards/preonic/keymaps/kuatsure/keymap.c | 216 +++++++++++++++++++ keyboards/preonic/keymaps/kuatsure/readme.md | 1 + keyboards/preonic/keymaps/kuatsure/rules.mk | 1 + quantum/audio/song_list.h | 14 +- users/kuatsure/kuatsure.c | 111 ++++++++++ users/kuatsure/kuatsure.h | 31 +++ users/kuatsure/readme.md | 14 ++ users/kuatsure/rules.mk | 1 + 9 files changed, 431 insertions(+), 1 deletion(-) create mode 100644 keyboards/preonic/keymaps/kuatsure/config.h create mode 100644 keyboards/preonic/keymaps/kuatsure/keymap.c create mode 100644 keyboards/preonic/keymaps/kuatsure/readme.md create mode 100644 keyboards/preonic/keymaps/kuatsure/rules.mk create mode 100644 users/kuatsure/kuatsure.c create mode 100644 users/kuatsure/kuatsure.h create mode 100644 users/kuatsure/readme.md create mode 100644 users/kuatsure/rules.mk diff --git a/keyboards/preonic/keymaps/kuatsure/config.h b/keyboards/preonic/keymaps/kuatsure/config.h new file mode 100644 index 00000000000..ba0ed525e03 --- /dev/null +++ b/keyboards/preonic/keymaps/kuatsure/config.h @@ -0,0 +1,43 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define GAME_SOUND VICTORY_FANFARE_SHORT + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(GAME_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif diff --git a/keyboards/preonic/keymaps/kuatsure/keymap.c b/keyboards/preonic/keymaps/kuatsure/keymap.c new file mode 100644 index 00000000000..63c3937fcad --- /dev/null +++ b/keyboards/preonic/keymaps/kuatsure/keymap.c @@ -0,0 +1,216 @@ +/* Copyright 2015-2017 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "kuatsure.h" + +enum preonic_layers { + _QWERTY, + _GAME, + _GAME_MOD, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + GAME, + GAME_MOD, + LOWER, + RAISE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Leader| Game | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_preonic_grid_wrapper( \ + KC_ESC, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ + KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, \ + KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ + KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, \ + KC_LEAD, GAME, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Game + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Leader|Qwerty| Alt | Spc |Game+ | Space |Game+ | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = LAYOUT_preonic_grid_wrapper( \ + KC_ESC, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ + KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, \ + KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ + KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, \ + KC_LEAD, QWERTY, KC_LALT, KC_SPC, GAME_MOD, KC_SPC, KC_SPC, GAME_MOD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Game Modifiers + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | ` | | 7 | 8 | 9 | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | ~ | | 4 | 5 | 6 | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Shift | F1 | F2 | F3 | F4 | | | 1 | 2 | 3 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | 0 | | | + * `-----------------------------------------------------------------------------------' + */ +[_GAME_MOD] = LAYOUT_preonic_grid_wrapper( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, ____________FUNCTION_3____________, KC_GRV, _______, KC_7, KC_8, KC_9, _______, _______, \ + _______, ____________FUNCTION_2____________, KC_TILD, _______, KC_4, KC_5, KC_6, _______, _______, \ + KC_LSFT, ____________FUNCTION_1____________, _______, _______, KC_1, KC_2, KC_3, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_0, _______, _______ \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | < | > | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | Up | | ` | | { | } | _ | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Del | Left | Down | Right| ~ | = | ( | ) | + | : | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Vol- | Prev | Play | Next | Vol+ | - | [ | ] | | ? | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Mute | | | | Esc | | Home | PgUp | PgDwn| End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_preonic_grid_wrapper( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_LT, KC_GT, _______, _______, _______, \ + _______, _______, _______, KC_UP, _______, KC_GRV, _______, KC_LCBR, KC_RCBR, KC_UNDS, _______, KC_PIPE, \ + _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TILD, KC_EQL, KC_LPRN, KC_RPRN, KC_PLUS, KC_COLN, KC_DQT , \ + _______, KC_VOLD, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLU, KC_MINS, KC_LBRC, KC_RBRC, _______, KC_QUES, _______, \ + _______, KC_MUTE, _______, _______, _______, KC_ESC, KC_ESC, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | E`~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | | | | | | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Enter | | Home | PgUp | PgDwn| End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_preonic_grid_wrapper( \ + KC_GESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, ____________FUNCTION_3____________, _______, _______, _______, _______, _______, _______, KC_BSPC, \ + _______, ____________FUNCTION_2____________, _______, _______, _______, _______, _______, _______, _______, \ + _______, ____________FUNCTION_1____________, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| Debug| | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | |Aud on|AudOff| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | |MusMod|Mus on|MusOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Qwerty| Game | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_preonic_grid_wrapper( \ + ____________FUNCTION_1____________, ____________FUNCTION_2____________, ____________FUNCTION_3____________, \ + _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, _______, _______, AU_ON, AU_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, MU_MOD, MU_ON, MU_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, QWERTY, GAME, _______, _______ \ +), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + + case GAME: + if (record->event.pressed) { + set_single_persistent_default_layer(_GAME); + } + return false; + break; + + case GAME_MOD: + if (record->event.pressed) { + layer_on(_GAME_MOD); + } else { + layer_off(_GAME_MOD); + } + return false; + break; + + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + } + return true; +}; diff --git a/keyboards/preonic/keymaps/kuatsure/readme.md b/keyboards/preonic/keymaps/kuatsure/readme.md new file mode 100644 index 00000000000..64cf5ae28ea --- /dev/null +++ b/keyboards/preonic/keymaps/kuatsure/readme.md @@ -0,0 +1 @@ +# The kuatsure Preonic layout - largely based on the Preonic's & Keyboard Paradise V60's layout diff --git a/keyboards/preonic/keymaps/kuatsure/rules.mk b/keyboards/preonic/keymaps/kuatsure/rules.mk new file mode 100644 index 00000000000..76d73acef75 --- /dev/null +++ b/keyboards/preonic/keymaps/kuatsure/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = no diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 1ddcfb345cd..8bcc1a9220a 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -187,7 +187,7 @@ Q__NOTE(_AS5 ), \ Q__NOTE(_B5), \ Q__NOTE(_C6 ), \ - Q__NOTE(_CS6 ), + Q__NOTE(_CS6 ), #define MAJOR_SOUND \ Q__NOTE(_A5 ), \ @@ -423,4 +423,16 @@ H__NOTE(_FS5), \ H__NOTE(_D5 ), \ +#define VICTORY_FANFARE_SHORT \ + ED_NOTE(_C6), \ + ED_NOTE(_C6), \ + ED_NOTE(_C6), \ + ED_NOTE(_C6), \ + W__NOTE(_REST), \ + QD_NOTE(_GS5), \ + QD_NOTE(_AS5), \ + Q__NOTE(_C6), \ + Q__NOTE(_AS5), \ + Q__NOTE(_C6), \ + #endif diff --git a/users/kuatsure/kuatsure.c b/users/kuatsure/kuatsure.c new file mode 100644 index 00000000000..a18713626ec --- /dev/null +++ b/users/kuatsure/kuatsure.c @@ -0,0 +1,111 @@ +#include "kuatsure.h" + +void tmux_prefix(void) { + register_code(KC_LCTL); + register_code(KC_SPC); + + unregister_code(KC_LCTL); + unregister_code(KC_SPC); +} + +void tmux_pane_zoom(void) { + tmux_prefix(); + + register_code(KC_Z); + unregister_code(KC_Z); +} + +void tmux_pane_switch(uint16_t keycode) { + tmux_prefix(); + + register_code(KC_Q); + unregister_code(KC_Q); + + register_code(keycode); + unregister_code(keycode); +} + +void tmux_window_switch(uint16_t keycode) { + tmux_prefix(); + + register_code(keycode); + unregister_code(keycode); +} + +LEADER_EXTERNS(); +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + // Available seqs + // SEQ_ONE_KEY, SEQ_TWO_KEYS, SEQ_THREE_KEYS + // anything you can do in a macro https://docs.qmk.fm/macros.html + // https://docs.qmk.fm/feature_leader_key.html + + // Whole Screen Shot + SEQ_ONE_KEY(KC_A) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_3); + + unregister_code(KC_3); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + + // Selective Screen Shot + SEQ_ONE_KEY(KC_S) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_4); + + unregister_code(KC_4); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + + // TMUX - shift to pane 1 and zoom + SEQ_ONE_KEY(KC_J) { + tmux_pane_switch(KC_1); + tmux_pane_zoom(); + } + + // TMUX - shift to pane 2 and zoom + SEQ_ONE_KEY(KC_K) { + tmux_pane_switch(KC_2); + tmux_pane_zoom(); + } + + // TMUX - shift to pane 3 and zoom + SEQ_ONE_KEY(KC_L) { + tmux_pane_switch(KC_3); + tmux_pane_zoom(); + } + + // TMUX - shift to last pane and zoom + SEQ_ONE_KEY(KC_SCOLON) { + tmux_prefix(); + + register_code(KC_SCOLON); + unregister_code(KC_SCOLON); + + tmux_pane_zoom(); + } + + // TMUX - shift to first window + SEQ_ONE_KEY(KC_U) { + tmux_window_switch(KC_1); + } + + // TMUX - shift to second window + SEQ_ONE_KEY(KC_I) { + tmux_window_switch(KC_2); + } + + // TMUX - shift to third window + SEQ_ONE_KEY(KC_O) { + tmux_window_switch(KC_3); + } + } +} diff --git a/users/kuatsure/kuatsure.h b/users/kuatsure/kuatsure.h new file mode 100644 index 00000000000..56fb684ec0f --- /dev/null +++ b/users/kuatsure/kuatsure.h @@ -0,0 +1,31 @@ +#ifndef KUATSURE +#define KUATSURE + +#include "quantum.h" + +void tmux_prefix(void); +void tmux_pane_zoom(void); +void tmux_pane_switch(uint16_t keycode); +void tmux_window_switch(uint16_t keycode); + +#undef LEADER_TIMEOUT +#define LEADER_TIMEOUT 300 + +#define LAYOUT_preonic_grid_wrapper(...) LAYOUT_preonic_grid(__VA_ARGS__) + +#define _________________NUMBER_L1_________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define _________________NUMBER_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0 + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + +#define ____________FUNCTION_1____________ KC_F1, KC_F2, KC_F3, KC_F4 +#define ____________FUNCTION_2____________ KC_F5, KC_F6, KC_F7, KC_F8 +#define ____________FUNCTION_3____________ KC_F9, KC_F10, KC_F11, KC_F12 + +#endif diff --git a/users/kuatsure/readme.md b/users/kuatsure/readme.md new file mode 100644 index 00000000000..b6d10224f82 --- /dev/null +++ b/users/kuatsure/readme.md @@ -0,0 +1,14 @@ +Copyright 2018 Jarrett Drouillard jarrett@thestyl.us @kuatsure + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/users/kuatsure/rules.mk b/users/kuatsure/rules.mk new file mode 100644 index 00000000000..11262d0ecfb --- /dev/null +++ b/users/kuatsure/rules.mk @@ -0,0 +1 @@ +SRC += kuatsure.c