From 62ba66d61821fec6a5ad3bdccdf738e15e082461 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Fri, 10 May 2019 18:55:02 -0500 Subject: Cleanup/rgb matrix (#5811) * clean up rgb matrix extern usage Moved rgb matrix boiler plate into macros Rebased onto typing heatmap pr * Fixing the reversed frame buffer access in digital rain * Fixing digital rain & typing heatmap if keyreactive effects are not enabled * Apply suggestions from code review Co-Authored-By: Drashna Jaelre * Adding parenthesizes to DRIVER_LED_TOTAL where necessary * Updated docs * added notes about parentheses --- users/drashna/rgb_stuff.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'users') diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 38e86ae0e..9e19747fa 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -5,8 +5,6 @@ #if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; bool has_initialized; -#elif defined(RGB_MATRIX_ENABLE) -extern rgb_config_t rgb_matrix_config; #endif #ifdef RGBLIGHT_ENABLE -- cgit v1.2.3 From 5c4707eafc5165904918fad7daff4e566f8f60df Mon Sep 17 00:00:00 2001 From: stanrc85 <47038504+stanrc85@users.noreply.github.com> Date: Sat, 11 May 2019 20:51:37 -0400 Subject: [Keymap] Minor keymap updates (#5850) * Move layer toggle key for one handed operation * Add print screen keycode * Cleaning up some tab/space formatting --- users/stanrc85/layer_rgb.c | 2 +- users/stanrc85/stanrc85.c | 4 ++-- users/stanrc85/stanrc85.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'users') diff --git a/users/stanrc85/layer_rgb.c b/users/stanrc85/layer_rgb.c index ac5d18122..23eeb3b08 100644 --- a/users/stanrc85/layer_rgb.c +++ b/users/stanrc85/layer_rgb.c @@ -5,7 +5,7 @@ void matrix_init_user(void) { }; uint32_t layer_state_set_user(uint32_t state) { - switch (biton32(state)) { + switch (biton32(state)) { case 0: rgblight_setrgb (0xFF, 0x00, 0x00); break; diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c index 78b0c4a14..e3da6d646 100644 --- a/users/stanrc85/stanrc85.c +++ b/users/stanrc85/stanrc85.c @@ -45,8 +45,8 @@ void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data) { } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK), - [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV), + [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK), + [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV), [TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_copy_finished, ctl_copy_reset) }; diff --git a/users/stanrc85/stanrc85.h b/users/stanrc85/stanrc85.h index da52df09b..b3d413fa1 100644 --- a/users/stanrc85/stanrc85.h +++ b/users/stanrc85/stanrc85.h @@ -20,7 +20,7 @@ #define TD_TCTL TD(TD_RCTL) enum cust_keys { - KC_MAKE = SAFE_RANGE, + KC_MAKE = SAFE_RANGE, KC_RDP }; -- cgit v1.2.3 From 8d46bb9cabb9c8e81c7ca1266d97a0126cc80767 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Sun, 12 May 2019 00:42:57 -0500 Subject: [Keyboard] Adding RGBKB Zygomorph Keyboard (#5841) * Initial Zygomorph 5x6 code Split is not working yet * layout changes implement 4 row config option (not done yet), remove layout comments in layout.c * Zygomorph layouts for 5x12, 5x6, 4x12, and 4x6 Also, info.json *should* be nearly usable for the configurator * temporary fix for pin D5 being broken * show D5 issue comment * add build notes * Pin B7 broken in split why? * remove fix * Fix some pin assignments * begin to fix keymap * Create new 5x6 layout * update key positions * Initial Zygomorph 5x6 code Split is not working yet * layout changes implement 4 row config option (not done yet), remove layout comments in layout.c * Zygomorph layouts for 5x12, 5x6, 4x12, and 4x6 Also, info.json *should* be nearly usable for the configurator * temporary fix for pin D5 being broken * show D5 issue comment * add build notes * Pin B7 broken in split why? * remove fix * Fix some pin assignments * begin to fix keymap * Create new 5x6 layout * Rough first pass at split common conversion. Keymap cleanup to cover just the basics. Broke OLED code out into separate example. * Fix readme * Removal of old encoder / oled driver, fix for layout macros * small update * xulkal zygomorph keymaps * Removed the LED_MIRRORED option as leds are always mirrored on Zygomorph * Xulkal keymaps update * split rgb light support * fix line endings * Apply suggestions from code review Co-Authored-By: zvecr * More layout and compile fixes from pr review * Cleaning up rules.mk files * Apply suggestions from code review Co-Authored-By: zvecr * Updating defaults * Apply suggestions from code review Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> --- users/xulkal/layouts.h | 4 ++-- users/xulkal/process_records.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'users') diff --git a/users/xulkal/layouts.h b/users/xulkal/layouts.h index 2cd309f76..61637bfe3 100644 --- a/users/xulkal/layouts.h +++ b/users/xulkal/layouts.h @@ -68,7 +68,7 @@ /* LOWER Layout * ,-----------------------------------------. ,-----------------------------------------. - * | | | | | | | | | | | | | | + * | |RGBMD |RGBRMD|RGBTOG| | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | SPDI | SAI | VAI | HUI | RESET| | | | | 7 | 8 | 9 | | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -80,7 +80,7 @@ * `-----------------------------------------' `-----------------------------------------' */ -#define __________________LOWER_L1_________________ _______, RGB_RMOD, RGB_MOD, _______, _______, _______ +#define __________________LOWER_L1_________________ _______, RGB_RMOD, RGB_MOD, RGB_TOG, _______, _______ #define __________________LOWER_L2_________________ RGB_SPI, RGB_SAI, RGB_VAI, RGB_HUI, RESET, _______ #define __________________LOWER_L3_________________ RGB_SPD, RGB_SAD, RGB_VAD, RGB_HUD, RGBRST, _______ #define __________________LOWER_L4_________________ _______, _______, _______, _______, _______, _______ diff --git a/users/xulkal/process_records.h b/users/xulkal/process_records.h index 9e4295380..d79ab7e32 100644 --- a/users/xulkal/process_records.h +++ b/users/xulkal/process_records.h @@ -31,10 +31,14 @@ enum { enum layer_number { _QWERTY = 0, +#ifndef GAMELAYER_DISABLE _GAME, +#endif _LOWER, _RAISE, +#ifdef TRILAYER_ENABLED _ADJUST +#endif }; enum custom_keycodes { -- cgit v1.2.3 From 9b46fabe084cd3e15104f88ef5d1f87f215de3c6 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Mon, 13 May 2019 09:58:15 -0500 Subject: Xulkal Keymap Changes (#5861) --- users/xulkal/config.h | 17 ++++++++++++++--- users/xulkal/layouts.h | 4 ++-- users/xulkal/process_records.c | 15 ++++++++++----- 3 files changed, 26 insertions(+), 10 deletions(-) (limited to 'users') diff --git a/users/xulkal/config.h b/users/xulkal/config.h index 2899017b0..ecd01f794 100644 --- a/users/xulkal/config.h +++ b/users/xulkal/config.h @@ -1,8 +1,6 @@ #pragma once -#ifndef TAPPING_FORCE_HOLD -#define TAPPING_FORCE_HOLD -#endif // TAPPING_FORCE_HOLD +#undef TAPPING_FORCE_HOLD #undef TAPPING_TERM #define TAPPING_TERM 175 @@ -12,6 +10,17 @@ #define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS #define RCPC_KEYS KC_RCTL, KC_TRNS, KC_EQL +// Running out of firmware space +#if defined(__AVR__) +#undef RGB_MATRIX_KEYPRESSES +#undef RGB_MATRIX_KEYRELEASES +#undef RGB_MATRIX_FRAMEBUFFER_EFFECTS +#else +#define RGB_MATRIX_KEYPRESSES +#undef RGB_MATRIX_KEYRELEASES +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#endif + // No need for the single versions when multi performance isn't a problem =D #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS @@ -20,8 +29,10 @@ #define DISABLE_RGB_MATRIX_SOLID_SPLASH // Don't like or feel to identical to other effects +#if defined(__AVR__) #define DISABLE_RGB_MATRIX_RAINBOW_BEACON #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS #define DISABLE_RGB_MATRIX_DIGITAL_RAIN #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#endif diff --git a/users/xulkal/layouts.h b/users/xulkal/layouts.h index 61637bfe3..5180992a8 100644 --- a/users/xulkal/layouts.h +++ b/users/xulkal/layouts.h @@ -50,7 +50,7 @@ * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | PREV | VOL- | VOL+ | NEXT | PLAY | + * | | | | | | | | | PREV | VOL+ | VOL- | NEXT | PLAY | * `-----------------------------------------' `-----------------------------------------' */ @@ -64,7 +64,7 @@ #define __________________RAISE_R2_________________ _______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, _______ #define __________________RAISE_R3_________________ _______, KC_DEL, KC_END, KC_PGDN, KC_SLCK, _______ #define __________________RAISE_R4_________________ _______, _______, _______, _______, _______, _______ -#define __________________RAISE_R5_________________ _______, KC_MPRV, KC_MPRV, KC_VOLD, KC_MNXT, KC_MPLY +#define __________________RAISE_R5_________________ _______, KC_MPRV, KC_VOLU, KC_VOLD, KC_MNXT, KC_MPLY /* LOWER Layout * ,-----------------------------------------. ,-----------------------------------------. diff --git a/users/xulkal/process_records.c b/users/xulkal/process_records.c index 531f99eb0..7c2b5e133 100644 --- a/users/xulkal/process_records.c +++ b/users/xulkal/process_records.c @@ -16,13 +16,13 @@ extern void eeconfig_update_rgb_matrix_default(void); #endif bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t reset_timer; switch (keycode) { case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } return false; - break; case GAME: #ifndef GAMELAYER_DISABLE if (record->event.pressed) { @@ -30,7 +30,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } #endif return false; - break; case LOWER: if (record->event.pressed) { layer_on(_LOWER); @@ -44,7 +43,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif } return false; - break; case RAISE: if (record->event.pressed) { layer_on(_RAISE); @@ -58,7 +56,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif } return false; - break; case RGBRST: #if defined(RGBLIGHT_ENABLE) if (record->event.pressed) { @@ -71,7 +68,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } #endif return false; - break; + case RESET: + if (record->event.pressed) { + reset_timer = timer_read(); + } else { + if (timer_elapsed(reset_timer) >= 500) { + reset_keyboard(); + } + } + return false; } return process_record_keymap(keycode, record) && -- cgit v1.2.3 From b68d8fe82eac0be9ca8862fdf94ae4bfbbb0735e Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Tue, 14 May 2019 21:02:22 +0200 Subject: [Keymap] Pvinis master (#5843) * trying to make my global keymap * refactoring the old keymap using userspace * getting there * move readme and remove community layout * use pragma once instead of ifndefs * just make iris work * iris decent * better naming * add some modifiers on the home row * use symbol and sysctl layers * fix up * a bit faster * add < and > on symbol layer * apparently im not using z all that much.. * okok * fix up stuff * led init is back * bring back led indicators * Update keyboards/ergotravel/keymaps/pvinis/config.h Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * not needed * not needed * delete these for now, until I use the userspace code * remove katamari from here. made a new pr for it * lower case * drashna suggestion :) * move files to correct place * fix missing command --- users/pvinis/config.h | 9 +++ users/pvinis/pvinis.c | 79 ++++++++++++++++++++++++++ users/pvinis/pvinis.h | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++ users/pvinis/rules.mk | 15 +++++ 4 files changed, 255 insertions(+) create mode 100644 users/pvinis/config.h create mode 100644 users/pvinis/pvinis.c create mode 100644 users/pvinis/pvinis.h create mode 100644 users/pvinis/rules.mk (limited to 'users') diff --git a/users/pvinis/config.h b/users/pvinis/config.h new file mode 100644 index 000000000..7f17f2d02 --- /dev/null +++ b/users/pvinis/config.h @@ -0,0 +1,9 @@ +#pragma once + +#ifdef AUDIO_ENABLE +// #define STARTUP_SONG SONG(SONIC_RING) +#endif + +// allow rolling when keys have hold functionality +#define IGNORE_MOD_TAP_INTERRUPT +// #define TAPPING_TERM 150 diff --git a/users/pvinis/pvinis.c b/users/pvinis/pvinis.c new file mode 100644 index 000000000..754403579 --- /dev/null +++ b/users/pvinis/pvinis.c @@ -0,0 +1,79 @@ +#include "pvinis.h" +#include "version.h" + +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif // AUDIO_ENABLE + + +#ifdef AUDIO_ENABLE +// float tone_katamari_rolling_star[][2] = SONG(KATAMARI_ROLLING_STAR); +#endif // AUDIO_ENABLE + + +// SYMBOL + SYSCTL = KBCTL +uint32_t layer_state_set_user(uint32_t state) { + uint32_t intermediate_state = update_tri_layer_state(state, LR_SYMBOL, LR_SYSCTL, LR_KBCTL); + intermediate_state = layer_state_set_user_local(intermediate_state); + return intermediate_state; +} + + +// functions for the individual keymaps to implement if they need something extra +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +// handle my own keycodes +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + + case PV_VRSN: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + + case PV_MAKE: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP +#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) + ":dfu" +#elif defined(BOOTLOADER_HALFKAY) + ":teensy" +#elif defined(BOOTLOADER_CATERINA) + ":avrdude" +#endif + SS_TAP(X_ENTER) + ); + } + return false; + + case PV_FLSH: + reset_keyboard(); + return false; + + case PV_KTMR: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + // PLAY_SONG(tone_katamari_rolling_star); +#endif + } + return false; + } + return process_record_keymap(keycode, record); +} + + +#ifdef TAP_DANCE_ENABLE +qk_tap_dance_action_t tap_dance_actions[] = { +}; +#endif // TAP_DANCE_ENABLE + + +// init stuff +void keyboard_post_init_user(void) { + keyboard_post_init_user_local(); +} diff --git a/users/pvinis/pvinis.h b/users/pvinis/pvinis.h new file mode 100644 index 000000000..0c5e2841a --- /dev/null +++ b/users/pvinis/pvinis.h @@ -0,0 +1,152 @@ +#pragma once + +#include "quantum.h" + + +// my own keycodes +enum userspace_custom_keycodes { + PV_ = SAFE_RANGE, + + PV_VRSN, // prints firmware version + PV_MAKE, // prints the make command of the keyboard + PV_FLSH, // resets keyboard + PV_KTMR, // play katamari music + + PV_SAFE_RANGE, // used for extra keycodes in the individual keymaps +}; + +enum tap_dance_indexes { + // tap dance + TD_FLSH, // flash keyboard (as if the physical flash key was pressed) +}; + +#define ALLM(kc) LCAG(kc) // easier name for left ctrl-alt-gui +#define PV_ESCC CTL_T(KC_ESC) // esc on tap, ctrl on hold +#define PV_LOCK LCTL(LSFT(KC_PWR)) // lock computer +#define TD_3FLS TD(TD_FLSH) // tap dance 3 times for flash + + +// layers +enum { + LR_BASE = 0, // used for basic keys like the surrounding ctrl, cmd, etc + + LR_QWERTY, + LR_CARPALX, + + LR_SYMBOL, // symbol input (!, @, #, etc) + LR_SYSCTL, // system control (music, volume, keyboard flash, etc) + LR_KBCTL, // keyboard control (version, make, flash, etc) +}; + + +// layer switchers +#define BASE TO(LR_BASE) +#define QWERTY TO(LR_QWERTY) +#define CARPALX TO(LR_CARPALX) + +#define SYMBOL MO(LR_SYMBOL) +#define SYSCTL MO(LR_SYSCTL) +#define KBCTL MO(LR_KBCTL) + + +// layout parts for easy reuse between keyboard keymaps + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define ________________NUMBERS_L__________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBERS_R__________________ KC_6, KC_7, KC_8, KC_9, KC_0 + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define ______________________F_L__________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define ______________________F_R__________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | Q | W | E | R | T | | Y | U | I | O | P | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | A | S | D | F | G | | H | J | K | L | ; | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | Z | X | C | V | B | | N | M | , | . | / | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#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_SLSH + +#define _____________MOD_QWERTY_L2_________________ KC_A , SFT_T(KC_S), GUI_T(KC_D), KC_F , KC_G +#define _____________MOD_QWERTY_R2_________________ KC_H , KC_J , GUI_T(KC_K), SFT_T(KC_L), KC_SCLN + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | Q | G | M | L | W | | Y | F | I | O | P | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | D | S | T | N | R | | I | A | K | L | ; | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | Z | X | C | V | J | | K | P | , | . | / | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define ________________CARPALX_L1_________________ KC_Q , KC_G , KC_M , KC_L , KC_W +#define ________________CARPALX_L2_________________ KC_D , KC_S , KC_T , KC_N , KC_R +#define ________________CARPALX_L3_________________ KC_Z , KC_X , KC_C , KC_V , KC_J + +#define ________________CARPALX_R1_________________ KC_Y , KC_F , KC_U , KC_B , KC_SCLN +#define ________________CARPALX_R2_________________ KC_I , KC_A , KC_E , KC_O , KC_H +#define ________________CARPALX_R3_________________ KC_K , KC_P , KC_COMM, KC_DOT , KC_SLSH + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | ! | @ | { | } | _ | | \ | | ` | | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | # | $ | ( | ) | - | | = | & | ' | " | | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | % | ^ | [ | ] | + | | * | ~ | < | > | / | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define _________________SYMBOL_L1_________________ KC_EXLM, KC_AT , KC_LCBR, KC_RCBR, KC_UNDS +#define _________________SYMBOL_L2_________________ KC_HASH, KC_DLR , KC_LPRN, KC_RPRN, KC_MINS +#define _________________SYMBOL_L3_________________ KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_PLUS + +#define _________________SYMBOL_R1_________________ KC_BSLS, _______, KC_GRV , _______, _______ +#define _________________SYMBOL_R2_________________ KC_EQL , KC_AMPR, KC_QUOT, KC_DQUO, KC_PIPE +#define _________________SYMBOL_R3_________________ KC_ASTR, KC_TILD, KC_LABK, KC_RABK, KC_SLSH + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// | | | | | | |MUTE |HOME | ^ | END | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | | | | | | |VOLUP| < | v | > | | +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// | | | | | | |VOLDN|MPREV|MPLAY|MNEXT| | +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define _________________SYSCTL_L1_________________ +#define _________________SYSCTL_L2_________________ +#define _________________SYSCTL_L3_________________ + +// vol v ctl v +#define _________________SYSCTL_R1_________________ KC_MUTE , KC_HOME , KC_UP , KC_END , PV_LOCK +#define _________________SYSCTL_R2_________________ KC_VOLU , KC_LEFT , KC_DOWN , KC_RGHT /* < arrows */ , KC_SLEP +#define _________________SYSCTL_R3_________________ KC_VOLD , KC_MPRV , KC_MPLY , KC_MNXT /* < music */ , KC_PWR + +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|VERSN|MAKE |FLASH|XXXXX| +// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, +// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| +// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, +#define __________________KBCTL_L1_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +#define __________________KBCTL_L2_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX +#define __________________KBCTL_L3_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + +#define __________________KBCTL_R1_________________ XXXXXXX, XXXXXXX, XXXXXXX, PV_KTMR, XXXXXXX +#define __________________KBCTL_R2_________________ XXXXXXX, PV_VRSN, PV_MAKE, PV_FLSH, XXXXXXX +#define __________________KBCTL_R3_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + +// we need wrappers in order for these definitions, because they need to be expanded before being used as arguments to the LAYOUT_xxx macro +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) + + +// extra stuff that might be needed +void keyboard_post_init_user_local(void); +uint32_t layer_state_set_user_local(uint32_t state); diff --git a/users/pvinis/rules.mk b/users/pvinis/rules.mk new file mode 100644 index 000000000..da10cc743 --- /dev/null +++ b/users/pvinis/rules.mk @@ -0,0 +1,15 @@ +# add userspace file +SRC += pvinis.c + +AUDIO_ENABLE = no # piezo speaker sounds +RGBLIGHT_ENABLE = no # rgb leds underlight +TAP_DANCE_ENABLE = yes +BACKLIGHT_ENABLE = no # leds under keycaps +#MOUSEKEY_ENABLE = no +#SLEEP_LED_ENABLE = no # no led blinking while sleeping +#NKRO_ENABLE = yes + +# make firmware smaller +LINK_TIME_OPTIMIZATION_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no -- cgit v1.2.3 From 1a28906a3da1f14034b81871b90bcce0ed56c286 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Thu, 16 May 2019 18:38:28 +0200 Subject: [Keymap] Pvinis/update for iris (#5889) * add default functions * some indenting * add ctl and alt * maybe? --- users/pvinis/config.h | 1 + users/pvinis/pvinis.c | 10 ++++++++++ users/pvinis/pvinis.h | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'users') diff --git a/users/pvinis/config.h b/users/pvinis/config.h index 7f17f2d02..8e2efb40a 100644 --- a/users/pvinis/config.h +++ b/users/pvinis/config.h @@ -2,6 +2,7 @@ #ifdef AUDIO_ENABLE // #define STARTUP_SONG SONG(SONIC_RING) +// #define DAC_SAMPLE_MAX 65535U // maybe this works for volume? #endif // allow rolling when keys have hold functionality diff --git a/users/pvinis/pvinis.c b/users/pvinis/pvinis.c index 754403579..e97edcb98 100644 --- a/users/pvinis/pvinis.c +++ b/users/pvinis/pvinis.c @@ -77,3 +77,13 @@ qk_tap_dance_action_t tap_dance_actions[] = { void keyboard_post_init_user(void) { keyboard_post_init_user_local(); } + + +// default functions +__attribute__ ((weak)) +void keyboard_post_init_user_local(void) {} + +__attribute__ ((weak)) +uint32_t layer_state_set_user_local(uint32_t state) { + return state; +} diff --git a/users/pvinis/pvinis.h b/users/pvinis/pvinis.h index 0c5e2841a..0c75c6a66 100644 --- a/users/pvinis/pvinis.h +++ b/users/pvinis/pvinis.h @@ -78,8 +78,8 @@ enum { #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_SLSH -#define _____________MOD_QWERTY_L2_________________ KC_A , SFT_T(KC_S), GUI_T(KC_D), KC_F , KC_G -#define _____________MOD_QWERTY_R2_________________ KC_H , KC_J , GUI_T(KC_K), SFT_T(KC_L), KC_SCLN +#define _____________MOD_QWERTY_L2_________________ CTL_T(KC_A), SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G +#define _____________MOD_QWERTY_R2_________________ KC_H , ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), CTL_T(KC_SCLN) // ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // | Q | G | M | L | W | | Y | F | I | O | P | -- cgit v1.2.3 From 6af0c1e1293cbc50b7d5136c2c8260cec1d1a21b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 9 May 2019 23:50:30 -0700 Subject: Make sure that RGM Matrix is checked properly --- users/drashna/rules.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'users') diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 085840f1c..cdb9e5436 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -33,6 +33,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif endif +RGB_MATRIX_ENABLE ?= no ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) SRC += rgb_stuff.c endif -- cgit v1.2.3 From 6689f900fc0ed9022706af7605d40225a3348f63 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 13 May 2019 14:48:53 -0700 Subject: Consolidate RGB Matrix layer indication function And changes to iris --- users/drashna/rgb_stuff.c | 11 +++++++++++ users/drashna/rgb_stuff.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'users') diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 9e19747fa..342186617 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -334,3 +334,14 @@ uint32_t layer_state_set_rgb(uint32_t state) { return state; } + +#ifdef RGB_MATRIX_ENABLE +extern led_config_t g_led_config; +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], led_type)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } +} +#endif diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 886f20ffc..572104612 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -19,3 +19,5 @@ uint32_t layer_state_set_rgb(uint32_t state); uint32_t default_layer_state_set_rgb(uint32_t state); void rgblight_sethsv_default_helper(uint8_t index); void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); + +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type); -- cgit v1.2.3 From bcfc24fd13661612b4af3836b174fe02960a13e7 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 13 May 2019 21:03:17 -0700 Subject: Update KC_MAKE macro to better handle crkbd split --- users/drashna/process_records.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'users') diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index a5487b585..770219917 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -39,22 +39,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { clear_mods(); clear_oneshot_mods(); send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY); #ifndef MAKE_BOOTLOADER - if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) + if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) +#endif + { + #if defined(__arm__) + send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); + #endif // bootloader options + } + if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } +#ifdef RGB_MATRIX_SPLIT_RIGHT + send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY); #endif - { - #if defined(__arm__) - send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY); - #endif // bootloader options - } - if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); } send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); } + break; case VRSN: // Prints firmware version -- cgit v1.2.3 From 89e9785d7a87e8dbb941dd272c032f34658169fd Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 17 May 2019 15:21:45 -0700 Subject: Update my code to use layer_state_t typedef --- users/drashna/drashna.c | 8 ++++---- users/drashna/drashna.h | 4 ++-- users/drashna/rgb_stuff.c | 2 +- users/drashna/rgb_stuff.h | 4 ++-- users/drashna/template.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'users') diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 7c60a2e4a..acc6b9f9e 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -187,13 +187,13 @@ void matrix_scan_user(void) { __attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { +layer_state_t layer_state_set_keymap (layer_state_t state) { return state; } // on layer change, no matter where the change was initiated // Then runs keymap's layer change check -uint32_t layer_state_set_user(uint32_t state) { +layer_state_t layer_state_set_user(layer_state_t state) { state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); #ifdef RGBLIGHT_ENABLE state = layer_state_set_rgb(state); @@ -203,12 +203,12 @@ uint32_t layer_state_set_user(uint32_t state) { __attribute__ ((weak)) -uint32_t default_layer_state_set_keymap (uint32_t state) { +layer_state_t default_layer_state_set_keymap (layer_state_t state) { return state; } // Runs state check and changes underglow color and animation -uint32_t default_layer_state_set_user(uint32_t state) { +layer_state_t default_layer_state_set_user(layer_state_t state) { state = default_layer_state_set_keymap(state); #if 0 #ifdef RGBLIGHT_ENABLE diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 5df67792a..507504f04 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -67,8 +67,8 @@ void shutdown_keymap(void); void suspend_power_down_keymap(void); void suspend_wakeup_init_keymap(void); void matrix_scan_keymap(void); -uint32_t layer_state_set_keymap (uint32_t state); -uint32_t default_layer_state_set_keymap (uint32_t state); +layer_state_t layer_state_set_keymap (layer_state_t state); +layer_state_t default_layer_state_set_keymap (layer_state_t state); void led_set_keymap(uint8_t usb_led); void eeconfig_init_keymap(void); diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 342186617..7d364fa68 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -275,7 +275,7 @@ void matrix_scan_rgb(void) { } -uint32_t layer_state_set_rgb(uint32_t state) { +layer_state_t layer_state_set_rgb(layer_state_t state) { #ifdef RGBLIGHT_ENABLE if (userspace_config.rgb_layer_change) { switch (biton32(state)) { diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 572104612..f5bbd0f3b 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -15,8 +15,8 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record); void scan_rgblight_fadeout(void); void keyboard_post_init_rgb(void); void matrix_scan_rgb(void); -uint32_t layer_state_set_rgb(uint32_t state); -uint32_t default_layer_state_set_rgb(uint32_t state); +layer_state_t layer_state_set_rgb(layer_state_t state); +layer_state_t default_layer_state_set_rgb(layer_state_t state); void rgblight_sethsv_default_helper(uint8_t index); void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); diff --git a/users/drashna/template.c b/users/drashna/template.c index 0e188f3a5..d90e6bdec 100644 --- a/users/drashna/template.c +++ b/users/drashna/template.c @@ -62,11 +62,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { __attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { +layer_state_t layer_state_set_keymap (layer_state_t state) { return state; } -uint32_t layer_state_set_user (uint32_t state) { +layer_state_t layer_state_set_user (layer_state_t state) { return layer_state_set_keymap (state); } -- cgit v1.2.3 From a0d6c5a1136e2c56aa4a57eac08355c2b5d79ad5 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Sun, 19 May 2019 11:15:50 -0500 Subject: [Keymap] Update Xulkal user code (#5920) --- users/xulkal/config.h | 10 +------- users/xulkal/process_records.c | 56 ++++++------------------------------------ users/xulkal/process_records.h | 18 +++++++++----- 3 files changed, 20 insertions(+), 64 deletions(-) (limited to 'users') diff --git a/users/xulkal/config.h b/users/xulkal/config.h index ecd01f794..c794530d4 100644 --- a/users/xulkal/config.h +++ b/users/xulkal/config.h @@ -5,6 +5,7 @@ #undef TAPPING_TERM #define TAPPING_TERM 175 +#define SPACE_CADET_MODIFIER_CARRYOVER #define LSPO_KEYS KC_LSFT, KC_TRNS, KC_LBRC #define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC #define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS @@ -27,12 +28,3 @@ #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS #define DISABLE_RGB_MATRIX_SPLASH #define DISABLE_RGB_MATRIX_SOLID_SPLASH - -// Don't like or feel to identical to other effects -#if defined(__AVR__) -#define DISABLE_RGB_MATRIX_RAINBOW_BEACON -#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define DISABLE_RGB_MATRIX_DIGITAL_RAIN -#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#endif diff --git a/users/xulkal/process_records.c b/users/xulkal/process_records.c index 7c2b5e133..5ba59965f 100644 --- a/users/xulkal/process_records.c +++ b/users/xulkal/process_records.c @@ -15,47 +15,15 @@ qk_tap_dance_action_t tap_dance_actions[] = { extern void eeconfig_update_rgb_matrix_default(void); #endif +#ifdef TRILAYER_ENABLED +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} +#endif + bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint16_t reset_timer; switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - case GAME: -#ifndef GAMELAYER_DISABLE - if (record->event.pressed) { - set_single_persistent_default_layer(_GAME); - } -#endif - return false; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); -#ifdef TRILAYER_ENABLED - update_tri_layer(_LOWER, _RAISE, _ADJUST); -#endif - } else { - layer_off(_LOWER); -#ifdef TRILAYER_ENABLED - update_tri_layer(_LOWER, _RAISE, _ADJUST); -#endif - } - return false; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); -#ifdef TRILAYER_ENABLED - update_tri_layer(_LOWER, _RAISE, _ADJUST); -#endif - } else { - layer_off(_RAISE); -#ifdef TRILAYER_ENABLED - update_tri_layer(_LOWER, _RAISE, _ADJUST); -#endif - } - return false; case RGBRST: #if defined(RGBLIGHT_ENABLE) if (record->event.pressed) { @@ -79,20 +47,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; } - return process_record_keymap(keycode, record) && -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - process_record_rgb(keycode, record) && -#endif // RGBLIGHT_ENABLE; - true; + return process_record_keymap(keycode, record); } __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - - -__attribute__ ((weak)) -bool process_record_rgb(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/users/xulkal/process_records.h b/users/xulkal/process_records.h index d79ab7e32..8a195df5c 100644 --- a/users/xulkal/process_records.h +++ b/users/xulkal/process_records.h @@ -4,6 +4,17 @@ #define RIS_ESC LT(_RAISE, KC_ESC) #define RIS_CAPS LT(_RAISE, KC_CAPS) +#define QWERTY DF(_QWERTY) + +#ifndef GAMELAYER_DISABLE +#define GAME DF(_GAME) +#else +#define GAME KC_TRANSPARENT +#endif + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + #ifdef TAP_DANCE_ENABLE #include "process_tap_dance.h" @@ -42,12 +53,7 @@ enum layer_number { }; enum custom_keycodes { - QWERTY = SAFE_RANGE, - GAME, - LOWER, - RAISE, - RGBRST + RGBRST = SAFE_RANGE }; bool process_record_keymap(uint16_t keycode, keyrecord_t *record); -bool process_record_rgb(uint16_t keycode, keyrecord_t *record); -- cgit v1.2.3 From a0d5f0722f8d045903670babbdc76ad1c5842b7c Mon Sep 17 00:00:00 2001 From: stanrc85 <47038504+stanrc85@users.noreply.github.com> Date: Tue, 21 May 2019 13:59:08 -0400 Subject: [Keymap] Romac added and tweaks to existing keymaps (#5941) * Initial keymap for Romac * Formatting changes * keymap tweaks * Add new cycle layer key * add cycle layer code * initial upload * keymap updates * keymap updates * keymap updates for new layer names * new enum layers * case added for 4th layer * removed extra space for formatting --- users/stanrc85/layer_rgb.c | 25 ++++++++++++++----------- users/stanrc85/stanrc85.h | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'users') diff --git a/users/stanrc85/layer_rgb.c b/users/stanrc85/layer_rgb.c index 23eeb3b08..58f17489a 100644 --- a/users/stanrc85/layer_rgb.c +++ b/users/stanrc85/layer_rgb.c @@ -1,26 +1,29 @@ #include "stanrc85.h" void matrix_init_user(void) { - rgblight_setrgb(0xFF, 0x00, 0x00); + rgblight_setrgb(0xFF, 0x00, 0x00); }; uint32_t layer_state_set_user(uint32_t state) { switch (biton32(state)) { case 0: - rgblight_setrgb (0xFF, 0x00, 0x00); - break; + rgblight_setrgb (0xFF, 0x00, 0x00); + break; case 1: - rgblight_setrgb (0x00, 0xFF, 0x00); - break; + rgblight_setrgb (0x00, 0xFF, 0x00); + break; case 2: - rgblight_setrgb (0x00, 0x00, 0xFF); - break; + rgblight_setrgb (0x00, 0x00, 0xFF); + break; case 3: - rgblight_setrgb (0xFF, 0xFF, 0xFF); - break; + rgblight_setrgb (0xFF, 0xFF, 0xFF); + break; + case 4: + rgblight_setrgb (0xFF, 0x00, 0xFF); + break; default: // for any other layers, or the default layer - rgblight_setrgb (0xFF, 0x00, 0x00); - break; + rgblight_setrgb (0xFF, 0x00, 0x00); + break; } return state; } diff --git a/users/stanrc85/stanrc85.h b/users/stanrc85/stanrc85.h index b3d413fa1..ceb7167e1 100644 --- a/users/stanrc85/stanrc85.h +++ b/users/stanrc85/stanrc85.h @@ -3,10 +3,17 @@ #include "quantum.h" #include "version.h" -#define DEFAULT 0 //Custom ANSI -#define LAYER1 1 //Default ANSI (enable with Fn2+CAPS) -#define LAYER2 2 //Function keys, arrows, custom shortcuts, volume control -#define LAYER3 3 //RGB Underglow controls and RESET +enum my_layers { + _NUMPAD = 0, //Macropad numpad + _NAVKEY, //Macropad nav keys + _MEDIA, //Macropad media controls + _RGB, //Macropad RGB controls + _FN1PAD, //Macropad reset and make commands + _QWERTY = 0, //Qwerty with custom shortcuts and functions + _DEFAULT, //Default ANSI for gaming, enable with FN2+RCtl + _FN1_60, //Function keys, arrows, custom shortcuts, volume control + _FN2_60 //RGB Underglow controls and RESET +}; //Aliases for longer keycodes #define KC_CAD LALT(LCTL(KC_DEL)) @@ -14,10 +21,12 @@ #define CA_QUOT LCA(KC_QUOT) #define CA_SCLN LCA(KC_SCLN) #define KC_CTLE LCTL_T(KC_ESC) -#define LT_SPCF LT(2, KC_SPC) +#define LT_SPCF LT(_FN1_60, KC_SPC) #define TD_TESC TD(TD_ESC) #define TD_TWIN TD(TD_WIN) #define TD_TCTL TD(TD_RCTL) +#define CA_COPY LCTL(KC_C) +#define CA_PSTE LCTL(KC_V) enum cust_keys { KC_MAKE = SAFE_RANGE, -- cgit v1.2.3 From fcb56534111652b9fa19d9d8e7bce635c7a63eb6 Mon Sep 17 00:00:00 2001 From: Jonathan Rascher Date: Wed, 22 May 2019 23:08:48 -0500 Subject: [Keymap] Switch Quefrency keymap from I2C back to serial; factor common configs into userspace (#5951) * Switch Quefrency from flaky I2C back to serial * Lower mouse wheel speed on Quefrency slightly * Migrate common settings to userspace * Enable Bootmagic Lite for consistent reset to bootloader. * Turn off some undesired features across all keyboards. * Remove EEPROM reset keybinding from all keyboards since Bootmagic Lite also does an EEPROM reset. * Set backlight and underglow increments consistently across all keyboards since lots of them like to override the deafults. * Set mouse keys consistently across all keyboards. * Update function layer keymap images --- users/bcat/config.h | 31 +++++++++++++++++++++++++++++++ users/bcat/rules.mk | 11 +++++++++++ 2 files changed, 42 insertions(+) create mode 100644 users/bcat/config.h create mode 100644 users/bcat/rules.mk (limited to 'users') diff --git a/users/bcat/config.h b/users/bcat/config.h new file mode 100644 index 000000000..a29aded71 --- /dev/null +++ b/users/bcat/config.h @@ -0,0 +1,31 @@ +/* Turn off RGB lighting when the host goes to sleep. */ +#define RGBLIGHT_SLEEP + +/* Keep backlight and RGB level increments consistent across keyboards. */ +#undef BACKLIGHT_LEVELS +#undef RGBLIGHT_HUE_STEP +#undef RGBLIGHT_SAT_STEP +#undef RGBLIGHT_VAL_STEP + +#define BACKLIGHT_LEVELS 7 +#define RGVLIGHT_HUE_STEP 8 +#define RGVLIGHT_SAT_STEP 17 +#define RGVLIGHT_VAL_STEP 17 + +/* Make mouse operation smoother. */ +#undef MOUSEKEY_DELAY +#undef MOUSEKEY_INTERVAL + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 + +/* Lower mouse speed to adjust for reduced MOUSEKEY_INTERVAL. */ +#undef MOUSEKEY_MAX_SPEED +#undef MOUSEKEY_TIME_TO_MAX +#undef MOUSEKEY_WHEEL_MAX_SPEED +#undef MOUSEKEY_WHEEL_TIME_TO_MAX + +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 150 +#define MOUSEKEY_WHEEL_MAX_SPEED 3 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 150 diff --git a/users/bcat/rules.mk b/users/bcat/rules.mk new file mode 100644 index 000000000..59f82709a --- /dev/null +++ b/users/bcat/rules.mk @@ -0,0 +1,11 @@ +# Enable Bootmagic Lite to consistently reset to bootloader and clear EEPROM. +BOOTMAGIC_ENABLE = lite + +# Enable mouse and media keys on all keyboards. +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes + +# Disable some unwanted features on all keyboards. +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +NKRO_ENABLE = no -- cgit v1.2.3 From 03e53dc8a2958c44b03b3863c27ce29b94f81f08 Mon Sep 17 00:00:00 2001 From: Jarrett Drouillard Date: Thu, 23 May 2019 00:40:16 -0400 Subject: [Keymap] changes to my userspace and preonic keymap ( spring 2019 ) (#5881) * feat-user-kuatsure: abstract symbol row out * feat-user-kuatsure: abstract grouped bracket, brace, paren out * fix-preonic-kuatsure: remove eol as requested by @drashna * feat-user-kuatsure: add KC_MAKE and KC_FLSH thanks to @drashna for the help * chore-preonic-kuatsure: remove auto shift * chore-user-kuatsure: move leader seq's to macro syntax * feat-user-kuatsure: add `KC_VRSN` key plus use it preonic keymap * chore-user-kuatsure: namespace keyboard macros `KB` * chore-preonic-kuatsure: move some keyboardy keys around * chore-preonic-kuatsure: remove parens, brackets, braces from lower * chore-user-kuatsure: move tmux window shifts to dbl press leaders * feat-user-kuatsure: add a computer lock leader seq * fix-preonic-kuatsure: go back to lower brackets * chore-preonic-kuatsure: clear out raise * feat-various-kuatsure: add meh + tab mod tap * chore-preonic-kuatsure: `raise` eats `game_mod` layer * fix-preonic-kuatsure: reverse pg up and pg down * chore-user-kuatsure: add double tap to turn off music * chore-user-kuatsure: move like seqs together * chore-preonic-kuatsure: add a few more items to the num pad on raise * feat-user-kuatsure: re-enable td for <> keys * chore-user-kuatsure: give a little more grace period for leader * fix-user-kuatsure: give lock leader a gui buffer no timer or anything, but alfred doesn't boot up as quickly as I would like sometimes gui doesn't do anything but gives a little bit of a time bump * fix-user-kuatsure: changes from @drashna review --- users/kuatsure/kuatsure.c | 140 +++++++++++++++++++++++++++------------------- users/kuatsure/kuatsure.h | 32 ++++++++++- users/kuatsure/rules.mk | 1 + 3 files changed, 115 insertions(+), 58 deletions(-) (limited to 'users') diff --git a/users/kuatsure/kuatsure.c b/users/kuatsure/kuatsure.c index a18713626..f935e83c7 100644 --- a/users/kuatsure/kuatsure.c +++ b/users/kuatsure/kuatsure.c @@ -1,35 +1,62 @@ #include "kuatsure.h" +#include "version.h" -void tmux_prefix(void) { - register_code(KC_LCTL); - register_code(KC_SPC); +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LT), + [TD_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_GT) +}; - unregister_code(KC_LCTL); - unregister_code(KC_SPC); +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; } -void tmux_pane_zoom(void) { - tmux_prefix(); +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KB_MAKE: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); + } + return false; + break; + + case KB_VRSN: + if (!record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + + case KB_FLSH: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP + #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) + ":dfu " + #elif defined(BOOTLOADER_HALFKAY) + ":teensy " + #elif defined(BOOTLOADER_CATERINA) + ":avrdude " + #endif + SS_TAP(X_ENTER) + ); + + reset_keyboard(); + } + return false; + break; + } - register_code(KC_Z); - unregister_code(KC_Z); + return process_record_keymap(keycode, record); } -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_prefix(void) { + tap_code16(LCTL(KC_SPC)); } -void tmux_window_switch(uint16_t keycode) { +void tmux_pane_zoom(void) { tmux_prefix(); - register_code(keycode); - unregister_code(keycode); + SEND_STRING("z"); } LEADER_EXTERNS(); @@ -43,69 +70,70 @@ void matrix_scan_user(void) { // anything you can do in a macro https://docs.qmk.fm/macros.html // https://docs.qmk.fm/feature_leader_key.html + // Stop music and lock computer via alfred + SEQ_ONE_KEY(KC_H) { + SEND_STRING(SS_LGUI(" ") SS_TAP(X_LGUI) "afk" SS_TAP(X_ENTER)); + } + + // Stop music and lock computer via alfred + SEQ_TWO_KEYS(KC_H, KC_H) { + SEND_STRING(SS_LGUI(" ") SS_TAP(X_LGUI) "afk" SS_TAP(X_ENTER) SS_TAP(X_MEDIA_PLAY_PAUSE)); + } + // 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); + SEND_STRING(SS_LGUI(SS_LSFT("3"))); } // 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); + SEND_STRING(SS_LGUI(SS_LSFT("4"))); } // TMUX - shift to pane 1 and zoom SEQ_ONE_KEY(KC_J) { - tmux_pane_switch(KC_1); + tmux_prefix(); + SEND_STRING("q1"); tmux_pane_zoom(); } + // TMUX - shift to first window + SEQ_TWO_KEYS(KC_J, KC_J) { + tmux_prefix(); + SEND_STRING("1"); + } + // TMUX - shift to pane 2 and zoom SEQ_ONE_KEY(KC_K) { - tmux_pane_switch(KC_2); + tmux_prefix(); + SEND_STRING("q2"); tmux_pane_zoom(); } + // TMUX - shift to second window + SEQ_TWO_KEYS(KC_K, KC_K) { + tmux_prefix(); + SEND_STRING("2"); + } + // TMUX - shift to pane 3 and zoom SEQ_ONE_KEY(KC_L) { - tmux_pane_switch(KC_3); + tmux_prefix(); + SEND_STRING("q3"); tmux_pane_zoom(); } + // TMUX - shift to third window + SEQ_TWO_KEYS(KC_L, KC_L) { + tmux_prefix(); + SEND_STRING("3"); + } + // TMUX - shift to last pane and zoom SEQ_ONE_KEY(KC_SCOLON) { tmux_prefix(); - - register_code(KC_SCOLON); - unregister_code(KC_SCOLON); - + SEND_STRING(";"); 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 index 23d3c617c..8961d5621 100644 --- a/users/kuatsure/kuatsure.h +++ b/users/kuatsure/kuatsure.h @@ -3,12 +3,32 @@ #include "quantum.h" +enum kuatsure_keycodes { + KB_MAKE = SAFE_RANGE, + KB_FLSH, + KB_VRSN, + + USER_SAFE_RANGE, +}; + +enum { + TD_LBRC = 0, + TD_RBRC, +}; + +#define KT_LBRC TD(TD_LBRC) +#define KT_RBRC TD(TD_RBRC) + +#define TAPPING_TERM 200 + +#define LEADER_TIMEOUT 250 +#define LEADER_PER_KEY_TIMING + void tmux_prefix(void); void tmux_pane_zoom(void); -void tmux_pane_switch(uint16_t keycode); -void tmux_window_switch(uint16_t keycode); #define KT_CESC CTL_T(KC_ESC) +#define KT_MTAB MEH_T(KC_TAB) #undef LEADER_TIMEOUT #define LEADER_TIMEOUT 300 @@ -18,6 +38,9 @@ void tmux_window_switch(uint16_t keycode); #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 _________________SYMBOL_L1_________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________SYMBOL_R1_________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN + #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 @@ -30,4 +53,9 @@ void tmux_window_switch(uint16_t keycode); #define ____________FUNCTION_2____________ KC_F5, KC_F6, KC_F7, KC_F8 #define ____________FUNCTION_3____________ KC_F9, KC_F10, KC_F11, KC_F12 +#define ___SQBRACKETS___ KT_LBRC, KT_RBRC +#define _____PARENS_____ KC_LPRN, KC_RPRN +#define ____CRBRACES____ KC_LCBR, KC_RCBR +#define ___ANBRACKETS___ KC_LT, KC_GT + #endif diff --git a/users/kuatsure/rules.mk b/users/kuatsure/rules.mk index f0d295aad..ed7e92905 100644 --- a/users/kuatsure/rules.mk +++ b/users/kuatsure/rules.mk @@ -1,3 +1,4 @@ CONSOLE_ENABLE = no +TAP_DANCE_ENABLE = yes SRC += kuatsure.c -- cgit v1.2.3 From 287767bba10ac866fae2ffadd45b2315c1e184e6 Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Wed, 29 May 2019 07:44:43 -0700 Subject: Update 333fred keymaps and add new iris map. (#6010) * Update 333fred keymaps and add new iris map. * Fix iris key --- users/333fred/333fred.c | 38 ++++++++++++++++++++++---------------- users/333fred/333fred.h | 9 ++++++++- users/333fred/333fred_config.h | 1 + users/333fred/rgb.c | 12 ++++++------ 4 files changed, 37 insertions(+), 23 deletions(-) (limited to 'users') diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c index 3b2b36d02..79df8c4de 100644 --- a/users/333fred/333fred.c +++ b/users/333fred/333fred.c @@ -86,31 +86,37 @@ qk_tap_dance_action_t tap_dance_actions[] = { [TD_COPY_PASTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_copy_paste_finished, NULL) }; -void tap_dance_process_record(uint16_t keycode) { +void tap_dance_process_keycode(uint16_t keycode) { if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) { tap_dance_active = false; } } -__attribute__ ((weak)) -void matrix_init_rgb(void) {} - __attribute__ ((weak)) void layer_state_set_rgb(uint32_t state) {} -__attribute__ ((weak)) -void matrix_scan_user_keyboard(void) {} - -void matrix_scan_user() { - static bool first_run = true; - if (first_run) { - first_run = false; - matrix_init_rgb(); - } - matrix_scan_user_keyboard(); -} - uint32_t layer_state_set_user(uint32_t state) { layer_state_set_rgb(state); return state; } + +bool try_handle_macro(uint16_t keycode, keyrecord_t *record) { + switch (keycode) + { + case DLEFT: + if (record->event.pressed) + SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_LEFT)))); + return true; + case DRIGHT: + if (record->event.pressed) + SEND_STRING(SS_LGUI(SS_LALT(SS_TAP(X_RIGHT)))); + return true; + case PSCREEN_APP: + if (record->event.pressed) + SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN))); + return true; + + default: + return false; + } +} diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h index 0e6c6a196..17f3779b7 100644 --- a/users/333fred/333fred.h +++ b/users/333fred/333fred.h @@ -17,6 +17,13 @@ enum tap_dance_declarations { TD_COPY_PASTE, }; +enum custom_keys { + DLEFT = SAFE_RANGE, + DRIGHT, + PSCREEN_APP +}; + void tap_dance_sym_vim_finished(qk_tap_dance_state_t*, void*); void tap_dance_sym_vim_reset(qk_tap_dance_state_t*, void*); -void tap_dance_process_record(uint16_t); +void tap_dance_process_keycode(uint16_t); +bool try_handle_macro(uint16_t keycode, keyrecord_t *record); diff --git a/users/333fred/333fred_config.h b/users/333fred/333fred_config.h index b158e2d5a..c099072fc 100644 --- a/users/333fred/333fred_config.h +++ b/users/333fred/333fred_config.h @@ -1,3 +1,4 @@ #pragma once #define PERMISSIVE_HOLD +#define NO_ACTION_MACRO diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c index a3dfd905c..5a6d74b5a 100644 --- a/users/333fred/rgb.c +++ b/users/333fred/rgb.c @@ -1,16 +1,11 @@ #include "quantum.h" #include "333fred.h" -void matrix_init_rgb(void) { - rgblight_enable_noeeprom(); - rgblight_sethsv_noeeprom(270, 255, 20); -} - void layer_state_set_rgb(uint32_t state) { switch (biton32(state)) { case BASE: // purple - rgblight_sethsv_noeeprom(270, 255, 20); + rgblight_sethsv_noeeprom(255, 255, 20); break; case SYMB: // blue @@ -26,3 +21,8 @@ void layer_state_set_rgb(uint32_t state) { break; } } + +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); + layer_state_set_rgb(1); // Set layer 0 (bit 1) on +} -- cgit v1.2.3 From 4f788c2ae90583f64e0cec6545a3da75a5aff0f8 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Sat, 1 Jun 2019 16:39:31 -0500 Subject: [Keymap] Xulkal user changes (#6044) * Xulkal user changes Xulkal user changes * Reduce code duplication * Massive user code refactor --- users/xulkal/custom_encoder.c | 13 ++++++ users/xulkal/custom_encoder.h | 2 + users/xulkal/custom_keycodes.h | 28 ++++++++++++ users/xulkal/custom_oled.c | 96 +++++++++++++++++++++++++++++++++++++++++ users/xulkal/custom_oled.h | 2 + users/xulkal/custom_tap_dance.c | 61 ++++++++++++++++++++++++++ users/xulkal/custom_tap_dance.h | 26 +++++++++++ users/xulkal/layouts.h | 4 +- users/xulkal/process_records.c | 74 +++++++++++++++---------------- users/xulkal/process_records.h | 44 +------------------ users/xulkal/rules.mk | 7 ++- users/xulkal/timer_utils.c | 12 ++++++ users/xulkal/timer_utils.h | 6 +++ users/xulkal/xulkal.h | 3 ++ 14 files changed, 295 insertions(+), 83 deletions(-) create mode 100644 users/xulkal/custom_encoder.c create mode 100644 users/xulkal/custom_encoder.h create mode 100644 users/xulkal/custom_keycodes.h create mode 100644 users/xulkal/custom_oled.c create mode 100644 users/xulkal/custom_oled.h create mode 100644 users/xulkal/custom_tap_dance.c create mode 100644 users/xulkal/custom_tap_dance.h create mode 100644 users/xulkal/timer_utils.c create mode 100644 users/xulkal/timer_utils.h (limited to 'users') diff --git a/users/xulkal/custom_encoder.c b/users/xulkal/custom_encoder.c new file mode 100644 index 000000000..09f1cda0d --- /dev/null +++ b/users/xulkal/custom_encoder.c @@ -0,0 +1,13 @@ +#include "custom_encoder.h" + +#ifdef ENCODER_ENABLE +const uint16_t PROGMEM encoders[][2] = { + { KC_PGUP, KC_PGDN }, + { KC_DOWN, KC_UP } +} + +void encoder_update_user(uint8_t index, bool clockwise) +{ + tap_code16(pgm_read_word(&encoders[index][clockwise])); +} +#endif diff --git a/users/xulkal/custom_encoder.h b/users/xulkal/custom_encoder.h new file mode 100644 index 000000000..010d4b138 --- /dev/null +++ b/users/xulkal/custom_encoder.h @@ -0,0 +1,2 @@ +#pragma once +#include "quantum.h" diff --git a/users/xulkal/custom_keycodes.h b/users/xulkal/custom_keycodes.h new file mode 100644 index 000000000..d4ae0bd47 --- /dev/null +++ b/users/xulkal/custom_keycodes.h @@ -0,0 +1,28 @@ +#pragma once + +enum custom_keycodes { + RGBRST = SAFE_RANGE, +#ifndef TAP_DANCE_ENABLE + TD_MIN, + TD_COMM = TD_MIN, + TD_BSPC, + TD_DEL, + TD_DOT, + TD_MAX, +#endif + KEYMAP_SAFE_RANGE +}; + +#define RIS_ESC LT(_RAISE, KC_ESC) +#define RIS_CAPS LT(_RAISE, KC_CAPS) + +#define QWERTY DF(_QWERTY) + +#ifndef GAMELAYER_DISABLE +#define GAME DF(_GAME) +#else +#define GAME KC_TRANSPARENT +#endif + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) diff --git a/users/xulkal/custom_oled.c b/users/xulkal/custom_oled.c new file mode 100644 index 000000000..77e580b95 --- /dev/null +++ b/users/xulkal/custom_oled.c @@ -0,0 +1,96 @@ +#include "custom_oled.h" +#include "process_records.h" + +#include + +#ifdef OLED_DRIVER_ENABLE + +static void render_logo(void) +{ + static const char PROGMEM sol_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(sol_logo, false); +} + +static void render_status(void) +{ + // Render to mode icon + static const char PROGMEM mode_logo[2][3] = { + {0x97,0x98,0}, + {0xb7,0xb8,0} + }; + + oled_write_P(mode_logo[0], false); + +#if defined(RGB_MATRIX_ENABLE) + static char buffer[20] = {0}; + snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val); + oled_write(buffer, false); +#endif + + oled_write_P(mode_logo[1], false); + +#if defined(RGB_MATRIX_ENABLE) + snprintf(buffer, sizeof(buffer), " s%3d m%3d\n", rgb_matrix_config.speed, rgb_matrix_config.mode); + oled_write(buffer, false); +#endif + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + oled_write_P(PSTR("Layer: "), false); + switch (biton32(layer_state)) + { + case _QWERTY: +#ifndef GAMELAYER_DISABLE + switch (biton32(default_layer_state)) + { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _GAME: + oled_write_P(PSTR("Game\n"), false); + break; + default: + oled_write_P(PSTR("Undefined\n"), false); + break; + } +#else + oled_write_P(PSTR("Default\n"), false); +#endif + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; +#ifdef TRILAYER_ENABLED + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; +#endif + default: + oled_write_P(PSTR("Undefined\n"), false); + break; + } + + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(led_usb_state & (1<event.pressed) + { + if (td_keycode != keycode || timer_expired(td_timer)) + { + td_keycode = keycode; + td_timer = timer_read() + TAPPING_TERM; + } + else + run_tap_dance_double(1); + } + return false; + } + + if (td_keycode != KC_TRANSPARENT) + run_tap_dance_double(0); + return true; +} + +void matrix_scan_user(void) +{ + if (td_keycode != KC_TRANSPARENT && timer_expired(td_timer)) + run_tap_dance_double(0); +} + +#endif diff --git a/users/xulkal/custom_tap_dance.h b/users/xulkal/custom_tap_dance.h new file mode 100644 index 000000000..33398808d --- /dev/null +++ b/users/xulkal/custom_tap_dance.h @@ -0,0 +1,26 @@ +#pragma once +#include "quantum.h" + +#ifdef TAP_DANCE_ENABLE + +#include "process_tap_dance.h" + +//Tap Dance Declarations +enum { + COMM_QUOT = 0, + BACKSPACE, + DELETE, + DOT +}; + +#define TD_COMM TD(COMM_QUOT) +#define TD_BSPC TD(BACKSPACE) +#define TD_DEL TD(DELETE) +#define TD_DOT TD(DOT) + +#else + +void run_tap_dance_double(uint8_t i); +bool process_tap_dance_double(uint16_t keycode, keyrecord_t *record); + +#endif diff --git a/users/xulkal/layouts.h b/users/xulkal/layouts.h index 5180992a8..65dad8c63 100644 --- a/users/xulkal/layouts.h +++ b/users/xulkal/layouts.h @@ -15,7 +15,7 @@ */ #define _________________QWERTY_L1_________________ KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5 -#define _________________QWERTY_L2_________________ TD_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T #define _________________QWERTY_L3_________________ RIS_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G #define _________________QWERTY_L4_________________ KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B #define _________________QWERTY_L5_________________ KC_LCPO, KC_LGUI, LOWER, RAISE, KC_LALT, KC_SPC @@ -23,7 +23,7 @@ #define _________________QWERTY_R1_________________ KC_6, KC_7, KC_8, KC_9, KC_0, TD_BSPC #define _________________QWERTY_R2_________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS #define _________________QWERTY_R3_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT -#define _________________QWERTY_R4_________________ KC_N, KC_M, TD_COMM, KC_DOT, KC_SLASH, KC_RSPC +#define _________________QWERTY_R4_________________ KC_N, KC_M, TD_COMM, TD_DOT, KC_SLASH, KC_RSPC #define _________________QWERTY_R5_________________ KC_SPC, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_RCPC diff --git a/users/xulkal/process_records.c b/users/xulkal/process_records.c index 5ba59965f..115623caa 100644 --- a/users/xulkal/process_records.c +++ b/users/xulkal/process_records.c @@ -1,56 +1,58 @@ #include "process_records.h" - -#ifdef TAP_DANCE_ENABLE -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [COMM_QUOT] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_QUOT), - [BACKSPACE] = ACTION_TAP_DANCE_DOUBLE (KC_BSPACE, LCTL(KC_BSPACE)), - [TAP_TAB] = ACTION_TAP_DANCE_DOUBLE (KC_TAB, LSFT(KC_TAB)), - [CTRL_MINUS] = ACTION_TAP_DANCE_DOUBLE (KC_LCTL, KC_MINS), - [CTRL_PLUS] = ACTION_TAP_DANCE_DOUBLE (KC_RCTL, KC_EQL) -}; -#endif +#include "custom_keycodes.h" +#include "timer_utils.h" #if defined(RGB_MATRIX_ENABLE) extern void eeconfig_update_rgb_matrix_default(void); #endif #ifdef TRILAYER_ENABLED -uint32_t layer_state_set_user(uint32_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +uint32_t layer_state_set_user(uint32_t state) +{ + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } #endif -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static uint16_t reset_timer; - switch (keycode) { - case RGBRST: +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + static uint16_t reset_timer; + +#ifndef TAP_DANCE_ENABLE + if (!process_tap_dance_double(keycode, record)) + return false; +#endif + + switch (keycode) + { + case RGBRST: + { #if defined(RGBLIGHT_ENABLE) - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - } + if (record->event.pressed) + { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } #elif defined(RGB_MATRIX_ENABLE) - if (record->event.pressed) { - eeconfig_update_rgb_matrix_default(); - } + if (record->event.pressed) + eeconfig_update_rgb_matrix_default(); #endif - return false; - case RESET: - if (record->event.pressed) { - reset_timer = timer_read(); - } else { - if (timer_elapsed(reset_timer) >= 500) { - reset_keyboard(); - } - } - return false; + } + return false; + case RESET: + { + if (record->event.pressed) + reset_timer = timer_read() + 500; + else if (timer_expired(reset_timer)) + reset_keyboard(); + } + return false; } return process_record_keymap(keycode, record); } __attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) +{ + return true; } diff --git a/users/xulkal/process_records.h b/users/xulkal/process_records.h index 8a195df5c..701ef7e74 100644 --- a/users/xulkal/process_records.h +++ b/users/xulkal/process_records.h @@ -1,44 +1,6 @@ #pragma once #include "quantum.h" - -#define RIS_ESC LT(_RAISE, KC_ESC) -#define RIS_CAPS LT(_RAISE, KC_CAPS) - -#define QWERTY DF(_QWERTY) - -#ifndef GAMELAYER_DISABLE -#define GAME DF(_GAME) -#else -#define GAME KC_TRANSPARENT -#endif - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) - -#ifdef TAP_DANCE_ENABLE -#include "process_tap_dance.h" - -//Tap Dance Declarations -enum { - COMM_QUOT = 0, - BACKSPACE, - TAP_TAB, - CTRL_MINUS, - CTRL_PLUS -}; - -#define TD_COMM TD(COMM_QUOT) -#define TD_BSPC TD(BACKSPACE) -#define TD_TAB TD(TAP_TAB) -#define TD_LCTL TD(CTRL_MINUS) -#define TD_RCTL TD(CTRL_PLUS) -#else -#define TD_COMM KC_COMM -#define TD_BSPC KC_BSPACE -#define TD_TAB KC_TAB -#define TD_LCTL KC_LCTL -#define TD_RCTL KC_RCTL -#endif +#include "custom_tap_dance.h" enum layer_number { _QWERTY = 0, @@ -52,8 +14,4 @@ enum layer_number { #endif }; -enum custom_keycodes { - RGBRST = SAFE_RANGE -}; - bool process_record_keymap(uint16_t keycode, keyrecord_t *record); diff --git a/users/xulkal/rules.mk b/users/xulkal/rules.mk index 6758f52f5..50dc75d61 100644 --- a/users/xulkal/rules.mk +++ b/users/xulkal/rules.mk @@ -1,10 +1,13 @@ SRC += xulkal.c \ - process_records.c + process_records.c \ + custom_tap_dance.c \ + custom_encoder.c \ + custom_oled.c \ + timer_utils.c # Some usual defaults MOUSEKEY_ENABLE = no # Mouse keys (+4700) EXTRAKEY_ENABLE = yes # Audio control and System control (+450) -TAP_DANCE_ENABLE = yes # Enable the tap dance feature. (+1100) ifneq ($(strip $(DISABLE_LTO)), yes) EXTRAFLAGS += -flto diff --git a/users/xulkal/timer_utils.c b/users/xulkal/timer_utils.c new file mode 100644 index 000000000..5f5d9a1eb --- /dev/null +++ b/users/xulkal/timer_utils.c @@ -0,0 +1,12 @@ +#include "timer_utils.h" + +bool timer_expired(uint16_t last) +{ + return timer_read() - last < 0x8000; +} + +bool timer_expired32(uint32_t last) +{ + return timer_read32() - last < 0x80000000; +} + diff --git a/users/xulkal/timer_utils.h b/users/xulkal/timer_utils.h new file mode 100644 index 000000000..7e2a0b74d --- /dev/null +++ b/users/xulkal/timer_utils.h @@ -0,0 +1,6 @@ +#pragma once +#include "timer.h" +#include + +bool timer_expired(uint16_t last); +bool timer_expired32(uint32_t last); diff --git a/users/xulkal/xulkal.h b/users/xulkal/xulkal.h index ae7359923..9bc83b7de 100644 --- a/users/xulkal/xulkal.h +++ b/users/xulkal/xulkal.h @@ -2,3 +2,6 @@ #include "process_records.h" #include "layouts.h" +#include "timer_utils.h" +#include "custom_keycodes.h" +#include "custom_tap_dance.h" -- cgit v1.2.3 From de968eb310b82dbba7c69971ad0d1280aaac7b27 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Wed, 5 Jun 2019 18:14:35 -0500 Subject: [Keymap] Xulkal changes (#6075) --- users/xulkal/custom_oled.c | 166 +++++++++++++++++++++++++++++++--------- users/xulkal/custom_tap_dance.c | 3 +- users/xulkal/rules.mk | 1 + 3 files changed, 133 insertions(+), 37 deletions(-) (limited to 'users') diff --git a/users/xulkal/custom_oled.c b/users/xulkal/custom_oled.c index 77e580b95..d871e96f0 100644 --- a/users/xulkal/custom_oled.c +++ b/users/xulkal/custom_oled.c @@ -5,60 +5,112 @@ #ifdef OLED_DRIVER_ENABLE +#ifdef RGBLIGHT_ENABLE +rgblight_config_t rgblight_config; +#endif + static void render_logo(void) { - static const char PROGMEM sol_logo[] = { + static const char PROGMEM font_logo[] = { 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_write_P(sol_logo, false); + oled_write_P(font_logo, false); +} + +#if defined(OLED_90ROTATION) + +// TODO: Need to define this function / extern only for helix based split common keyboards +extern uint8_t is_master; +bool is_keyboard_master(void) +{ + return is_master; +} + +static void render_layer(uint8_t layer) +{ + switch (layer) + { + case _QWERTY: + oled_write_P(PSTR("DFLT "), false); + break; +#ifndef GAMELAYER_DISABLE + case _GAME: + oled_write_P(PSTR("GAME "), false); + break; +#endif + case _LOWER: + oled_write_P(PSTR("LOWER"), false); + break; + case _RAISE: + oled_write_P(PSTR("RAISE"), false); + break; +#ifdef TRILAYER_ENABLED + case _ADJUST: + oled_write_P(PSTR("ADJST"), false); + break; +#endif + } } static void render_status(void) { // Render to mode icon - static const char PROGMEM mode_logo[2][3] = { - {0x97,0x98,0}, - {0xb7,0xb8,0} - }; + static const char PROGMEM mode_logo[2][4] = { + {0x97,0x98,0x0a,0}, + {0xb7,0xb8,0x0a,0} }; oled_write_P(mode_logo[0], false); + oled_write_P(mode_logo[1], false); -#if defined(RGB_MATRIX_ENABLE) - static char buffer[20] = {0}; - snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val); - oled_write(buffer, false); -#endif + oled_write_P(PSTR("Layer"), false); + uint8_t layer = biton(layer_state); + if (layer != _QWERTY) + render_layer(layer); + else + render_layer(biton32(default_layer_state)); - oled_write_P(mode_logo[1], false); + // Host Keyboard LED Status + uint8_t led_usb_state = host_keyboard_leds(); + oled_write_P(led_usb_state & (1< Date: Thu, 6 Jun 2019 16:00:52 -0400 Subject: [Keymap] update @nstickney's keymaps (#6076) * [Keymap] iris@nstickney: improve RGB init Perfecting the rgb backlight initialization with a delay for each color; also start and stop the animation at the "default layer" color. * [Keymap] iris,ergodox@nstickney fix FN on SYMB The function key was not operational on the SYMB and SYSH layers due to other keycodes being mapped over MO() on those layers. The offending keycodes have been moved to other keys. * [Keymap] add @nstickney's userspace Pulled common code out to a userspace directory for my iris and ergodox keymaps. * [Keymap] iris@nstickney add image to README Added an image from keyboard-layout-editor.com to meet the README standard. * iris@nstickney hue values now `uint8_t` (#6050) --- users/nstickney/nstickney.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ users/nstickney/nstickney.h | 25 +++++++++++++++++++++++++ users/nstickney/rules.mk | 4 ++++ 3 files changed, 73 insertions(+) create mode 100644 users/nstickney/nstickney.c create mode 100644 users/nstickney/nstickney.h create mode 100644 users/nstickney/rules.mk (limited to 'users') diff --git a/users/nstickney/nstickney.c b/users/nstickney/nstickney.c new file mode 100644 index 000000000..3e18e5c83 --- /dev/null +++ b/users/nstickney/nstickney.c @@ -0,0 +1,44 @@ +#include "nstickney.h" + +// Tap Dancing +void dance_layer (qk_tap_dance_state_t *state, void *user_data) { + switch (state -> count) { + case 1: tap_code(KC_APP); break; + case 2: layer_invert(NUMP); break; + case 3: layer_invert(SYMB); break; + case 4: layer_invert(SYSH); break; + default: break; + } +}; + +void dance_lock_finished (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: register_code(KC_LGUI); break; + case 2: register_code(KC_NLCK); break; + case 3: register_code(KC_CAPS); break; + case 4: register_code(KC_SLCK); break; + default: break; + } +}; + +void dance_lock_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: unregister_code(KC_LGUI); break; + case 2: unregister_code(KC_NLCK); break; + case 3: register_code(KC_CAPS); break; + case 4: register_code(KC_SLCK); break; + default: break; + } +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [LOCKS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_lock_finished, dance_lock_reset), + [LAYERS] = ACTION_TAP_DANCE_FN(dance_layer) +}; + +void eeconfig_init_user (void) { + set_unicode_input_mode(UC_LNX); // Linux + //set_unicode_input_mode(UC_OSX); // Mac OSX + //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki) + //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki) +}; \ No newline at end of file diff --git a/users/nstickney/nstickney.h b/users/nstickney/nstickney.h new file mode 100644 index 000000000..d3f5a7c6f --- /dev/null +++ b/users/nstickney/nstickney.h @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +#pragma once +#define USE_SERIAL +#define MASTER_LEFT + +#undef UNICODE_SELECTED_MODES +#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WINC + +// Layers +#define BASE 0 // Base layer +#define SYMB 1 // Symbols +#define SYSH 2 // Symbols, shifted +#define NUMP 3 // Numpad +#define FCTN 4 // Function + +// Make keymaps more clear +#define CC_ESC LCTL_T(KC_ESC) +#define CC_QUOT RCTL_T(KC_QUOT) +#define AC_SLSH LALT_T(KC_SLSH) +#define AC_EQL RALT_T(KC_EQL) +#define FC_BSLS LT(FCTN, KC_BSLS) +#define FC_MINS LT(FCTN, KC_MINS) + +enum tap_dances {LOCKS = 0, LAYERS = 1}; \ No newline at end of file diff --git a/users/nstickney/rules.mk b/users/nstickney/rules.mk new file mode 100644 index 000000000..f52371c79 --- /dev/null +++ b/users/nstickney/rules.mk @@ -0,0 +1,4 @@ +SRC += nstickney.c + +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes \ No newline at end of file -- cgit v1.2.3 From c70016eee55db9f7e37a312922c509c670434461 Mon Sep 17 00:00:00 2001 From: Jonathan Rascher Date: Fri, 7 Jun 2019 14:58:23 -0500 Subject: [Keymap] Set a short TAP_CODE_DELAY so media keys work (#6097) A delay of 10ms seems sufficient. Otherwise, media keys tapped from the encoder of my BDN9 macropad only seem to get picked up by the OS (Windows 10) some of the time. --- users/bcat/config.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'users') diff --git a/users/bcat/config.h b/users/bcat/config.h index a29aded71..c5f731b73 100644 --- a/users/bcat/config.h +++ b/users/bcat/config.h @@ -1,3 +1,8 @@ +/* Delay between tap_code register and unregister to fix flaky media keys. */ +#undef TAP_CODE_DELAY + +#define TAP_CODE_DELAY 10 + /* Turn off RGB lighting when the host goes to sleep. */ #define RGBLIGHT_SLEEP -- cgit v1.2.3 From 53a81fc2f681eda7267804eb990bc24c4ef58512 Mon Sep 17 00:00:00 2001 From: Jonathan Rascher Date: Sun, 16 Jun 2019 02:35:46 -0500 Subject: [Keymap] Minor userspace and Quefrency keymap fixes (#6134) * Fix typo for RGBLIGHT config values It doesn't make a difference right now since these are the defaults in rgblight.h (which I'm just setting explicitly since some of the keyboard configs change these defaults). However, I'd rather be explicit, so fixing my typo. :) * Remove mouse keys layer from Quefrency keymap It's a fun idea, but I never use it in practice. --- users/bcat/config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'users') diff --git a/users/bcat/config.h b/users/bcat/config.h index c5f731b73..7d4200895 100644 --- a/users/bcat/config.h +++ b/users/bcat/config.h @@ -13,9 +13,9 @@ #undef RGBLIGHT_VAL_STEP #define BACKLIGHT_LEVELS 7 -#define RGVLIGHT_HUE_STEP 8 -#define RGVLIGHT_SAT_STEP 17 -#define RGVLIGHT_VAL_STEP 17 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 /* Make mouse operation smoother. */ #undef MOUSEKEY_DELAY -- cgit v1.2.3 From 83754c114684109b3ac37683e208a5e6e627272b Mon Sep 17 00:00:00 2001 From: SpacebarRacecar <42380065+SpacebarRacecar@users.noreply.github.com> Date: Mon, 17 Jun 2019 02:35:20 +0200 Subject: [Keymap] Update to personal keymaps (#6136) * changes to keymaps * changes to userspace * changes to userspace * removed reference to fc660c keymap which no longer exists from userspace readme * removed preonic keymap --- users/spacebarracecar/readme.md | 2 +- users/spacebarracecar/spacebarracecar.c | 10 ++++++++++ users/spacebarracecar/spacebarracecar.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'users') diff --git a/users/spacebarracecar/readme.md b/users/spacebarracecar/readme.md index 172764c07..3d9ceb80c 100644 --- a/users/spacebarracecar/readme.md +++ b/users/spacebarracecar/readme.md @@ -14,7 +14,7 @@ I'm using the US Ansi layout however I'm living in Germany which means that ever - The keycodes are handled by the `process_record_user` function which is now located in [spacebarracecar.c](spacebarracecar.c). To change keyboard specific configuration `process_record_keymap` is used (see [drashna userspace readme](../drashna/readme.md) for better explanation). - There is a predefined `_DEADKEY` layer in [spacebarracecar.h](spacebarracecar.h) under `enum userspace_layers`. Shifted CU_QUOT enables the dead key layer, just like KC_QUOT would when using the US International layout. (See `enum userspace_custom_keycodes` for more explanation). - On Windows grave and circonflexe are defined as dead keys when using the standard german layout. Those are automatically escaped when using the custom keycodes. `CU_ESCT` can be used to enable/disable this behavior. -- For a complete example see my [fc660c](../../keyboards/fc660c/keymaps/spacebarracecar/keymap.c) or [planck](../../keyboards/planck/keymaps/spacebarracecar/keymap.c) keymaps. +- For a complete example see my [planck](../../keyboards/planck/keymaps/spacebarracecar/keymap.c) keymap. ### How it works diff --git a/users/spacebarracecar/spacebarracecar.c b/users/spacebarracecar/spacebarracecar.c index 2ab10d945..bbd864aa9 100644 --- a/users/spacebarracecar/spacebarracecar.c +++ b/users/spacebarracecar/spacebarracecar.c @@ -71,6 +71,11 @@ void timer_timeout(void){ rshiftp = false; #endif navesc = false; + timer_timeout_keymap(); +} + +__attribute__((weak)) +void timer_timeout_keymap(void){ } bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -340,3 +345,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return process_record_keymap(keycode, record); } } + +__attribute__((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/users/spacebarracecar/spacebarracecar.h b/users/spacebarracecar/spacebarracecar.h index 690971c39..43bfc5e65 100644 --- a/users/spacebarracecar/spacebarracecar.h +++ b/users/spacebarracecar/spacebarracecar.h @@ -75,6 +75,8 @@ extern bool game; void timer_timeout(void); +void timer_timeout_keymap(void); + bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define CTRLX LCTL(KC_X) -- cgit v1.2.3 From b36bb58b7624533022dc38b02421c9f1d1f3f2e1 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Wed, 19 Jun 2019 00:50:05 -0700 Subject: Add ergodash layout, update the backlight numbers for the rgb backlight to be the actual intended colors. --- users/333fred/333fred.h | 1 + users/333fred/layout_macros.h | 44 +++++++++++++++++++++++++++++++++++++++++++ users/333fred/rgb.c | 6 +++--- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 users/333fred/layout_macros.h (limited to 'users') diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h index 17f3779b7..716b61a25 100644 --- a/users/333fred/333fred.h +++ b/users/333fred/333fred.h @@ -1,6 +1,7 @@ #pragma once #include "quantum.h" +#include "layout_macros.h" #define BASE 0 #define CODE 1 // code layer diff --git a/users/333fred/layout_macros.h b/users/333fred/layout_macros.h new file mode 100644 index 000000000..3b163f6ce --- /dev/null +++ b/users/333fred/layout_macros.h @@ -0,0 +1,44 @@ +#pragma once + +#define SIX_TRNS _______, _______, _______, _______, _______, _______ +#define FOUR_TRNS _______, _______, _______, _______ + +// Row 5: 6 keys +#define ROW5_LEFT_BASE KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5 +#define ROW5_RGHT_BASE KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS +#define ROW5_LEFT_SYMB _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define ROW5_RGHT_SYMB KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 +#define ROW5_LEFT_VIM SIX_TRNS +#define ROW5_RGHT_VIM SIX_TRNS + +// Row 4: 6 keys +#define ROW4_LEFT_BASE KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T +#define ROW4_RGHT_BASE KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS +#define ROW4_LEFT_SYMB _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE +#define ROW4_RGHT_SYMB KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12 +#define ROW4_LEFT_VIM SIX_TRNS +#define ROW4_RGHT_VIM SIX_TRNS + +// Row 3: 6 keys +#define ROW3_LEFT_BASE CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G +#define ROW3_RGHT_BASE KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT +#define ROW3_LEFT_SYMB _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV +#define ROW3_RGHT_SYMB KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______ +#define ROW3_LEFT_VIM _______, DLEFT, DRIGHT, KC_LCTL, KC_LGUI, _______ +#define ROW3_RGHT_VIM KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______ + +// Row 2: 6 keys +#define ROW2_LEFT_BASE OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B +#define ROW2_RGHT_BASE KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT) +#define ROW2_LEFT_SYMB _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD +#define ROW2_RGHT_SYMB KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______ +#define ROW2_LEFT_VIM _______, _______, KC_TAB, _______, _______, _______ +#define ROW2_RGHT_VIM SIX_TRNS + +// Row 1: 4 keys +#define ROW1_LEFT_BASE OSM(MOD_LCTL), KC_F4, KC_F5, KC_LALT +#define ROW1_RGHT_BASE KC_DOWN, KC_EQL, KC_RIGHT, KC_RGUI +#define ROW1_LEFT_SYMB _______, _______, _______, _______ +#define ROW1_RGHT_SYMB KC_0, KC_DOT, KC_EQL, _______ +#define ROW1_LEFT_VIM FOUR_TRNS +#define ROW1_RGHT_VIM FOUR_TRNS diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c index 5a6d74b5a..c86cd1c77 100644 --- a/users/333fred/rgb.c +++ b/users/333fred/rgb.c @@ -5,15 +5,15 @@ void layer_state_set_rgb(uint32_t state) { switch (biton32(state)) { case BASE: // purple - rgblight_sethsv_noeeprom(255, 255, 20); + rgblight_sethsv_noeeprom(210, 255, 20); break; case SYMB: // blue - rgblight_sethsv_noeeprom(240, 255, 20); + rgblight_sethsv_noeeprom(191, 255, 20); break; case VIM: // green - rgblight_sethsv_noeeprom(120, 255, 20); + rgblight_sethsv_noeeprom(85, 255, 20); break; case GAME: // red -- cgit v1.2.3 From 4be1dfcee48daeb77e966b08ad9ca51e02253acf Mon Sep 17 00:00:00 2001 From: Manna Harbour <51143715+manna-harbour@users.noreply.github.com> Date: Wed, 26 Jun 2019 17:33:12 +1000 Subject: [Keymap] miryoku layout (#6171) * First release * add "#pragma once" to config.h and related docs * generate config.h with change from miryoku.org --- users/manna-harbour_miryoku/README.org | 1 + users/manna-harbour_miryoku/config.h | 13 + .../manna-harbour_miryoku/manna-harbour_miryoku.c | 56 ++ users/manna-harbour_miryoku/miryoku.org | 609 +++++++++++++++++++++ users/manna-harbour_miryoku/rules.mk | 5 + 5 files changed, 684 insertions(+) create mode 120000 users/manna-harbour_miryoku/README.org create mode 100644 users/manna-harbour_miryoku/config.h create mode 100644 users/manna-harbour_miryoku/manna-harbour_miryoku.c create mode 100644 users/manna-harbour_miryoku/miryoku.org create mode 100644 users/manna-harbour_miryoku/rules.mk (limited to 'users') diff --git a/users/manna-harbour_miryoku/README.org b/users/manna-harbour_miryoku/README.org new file mode 120000 index 000000000..b6caaade1 --- /dev/null +++ b/users/manna-harbour_miryoku/README.org @@ -0,0 +1 @@ +miryoku.org \ No newline at end of file diff --git a/users/manna-harbour_miryoku/config.h b/users/manna-harbour_miryoku/config.h new file mode 100644 index 000000000..c3c513d06 --- /dev/null +++ b/users/manna-harbour_miryoku/config.h @@ -0,0 +1,13 @@ + +// generated from users/manna-harbour_miryoku/miryoku.org + +#pragma once + +// Prevent normal rollover on alphas from accidentally triggering mods. +#define IGNORE_MOD_TAP_INTERRUPT + +// Enable rapid switch from tap to hold, disables double tap hold auto-repeat. +#define TAPPING_FORCE_HOLD + +// Recommended for heavy chording. +#define QMK_KEYS_PER_SCAN 4 diff --git a/users/manna-harbour_miryoku/manna-harbour_miryoku.c b/users/manna-harbour_miryoku/manna-harbour_miryoku.c new file mode 100644 index 000000000..bb4770afc --- /dev/null +++ b/users/manna-harbour_miryoku/manna-harbour_miryoku.c @@ -0,0 +1,56 @@ + +// generated from users/manna-harbour_miryoku/miryoku.org + +#include QMK_KEYBOARD_H + +#define KC_NP KC_NO // key is not present +#define KC_NA KC_NO // present but not available for use +#define KC_NU KC_NO // available but not used +#define KC_RST RESET + +enum layers { BASE, MEDR, NAVR, MOUR, NSSL, NSL, FUNL }; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_miryoku( + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, + LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_M, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, + KC_NP, KC_NP, LT(MEDR, KC_ESC), LT(NAVR, KC_SPC), LT(MOUR, KC_TAB), LT(NSSL, KC_ENT), LT(NSL, KC_BSPC), LT(FUNL, KC_DEL), KC_NP, KC_NP + ), + [NAVR] = LAYOUT_miryoku( + KC_RST, KC_NA, KC_NA, KC_NA, KC_NA, KC_AGIN, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, + KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NA, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, + KC_NP, KC_NP, KC_NA, KC_NA, KC_NA, KC_ENT, KC_BSPC, KC_DEL, KC_NP, KC_NP + ), + [MOUR] = LAYOUT_miryoku( + KC_RST, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_NU, KC_NU, KC_NU, KC_NU, + KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NA, KC_NU, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, + KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, + KC_NP, KC_NP, KC_NA, KC_NA, KC_NA, KC_BTN3, KC_BTN1, KC_BTN2, KC_NP, KC_NP + ), + [MEDR] = LAYOUT_miryoku( + KC_RST, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_NU, KC_NU, KC_NU, KC_NU, + KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NA, KC_NU, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, + KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, KC_NU, KC_NU, KC_NU, KC_NU, KC_NU, + KC_NP, KC_NP, KC_NA, KC_NA, KC_NA, KC_MSTP, KC_MPLY, KC_MUTE, KC_NP, KC_NP + ), + [FUNL] = LAYOUT_miryoku( + KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, + KC_F11, KC_F4, KC_F5, KC_F6, KC_SLCK, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, + KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, + KC_NP, KC_NP, KC_APP, KC_SPC, KC_TAB, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP + ), + [NSL] = LAYOUT_miryoku( + KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, + KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, + KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, + KC_NP, KC_NP, KC_DOT, KC_0, KC_MINS, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP + ), + [NSSL] = LAYOUT_miryoku( + KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, + KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, + KC_NP, KC_NP, KC_GT, KC_RPRN, KC_UNDS, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP + ) +}; diff --git a/users/manna-harbour_miryoku/miryoku.org b/users/manna-harbour_miryoku/miryoku.org new file mode 100644 index 000000000..556f95f60 --- /dev/null +++ b/users/manna-harbour_miryoku/miryoku.org @@ -0,0 +1,609 @@ +#+Title: miryoku.org + +The miryoku layout is an ergonomic, minimal, orthogonal layout for ergo or ortho +keyboards, implemented as part of the QMK firmware. The layout is maintained in +emacs org-mode tables and converted to QMK keymap data structures using embedded +python scripts. The layout is mapped onto keyboards with different physical +layouts as a subset without code duplication using the QMK userland feature and +C macros. Versions of the layout can also be seen outside of the QMK source at +[[https://github.com/manna-harbour/miryoku/]]. + +* Contents + +- [[#layout][Layout]] +- [[#code-generation][Code Generation]] +- [[#subset-mapping][Subset Mapping]] + + +* Layout +:PROPERTIES: +:CUSTOM_ID: layout +:END: + +** Info + +*** General Principles + + - Use layers instead of reaching. + - Use both hands instead of contortions. + - Use the home positions as much as possible. + - Make full use of the thumbs. + - Avoid unnecessary complication. + + +*** Specifics + + - 5 columns, 3 rows, 3 thumb keys, 2 hands. + - Can be used on almost any split or non-split ergo or ortho keyboard. + - Includes all keys found on a US layout TKL keyboard, plus media keys and + mouse emulation. + - Home row is the middle row, home thumb key is the middle thumb key. + - Maximum 1-u movement from home position for fingers and thumbs, and only + along one axis (except for the inner index finger column which is + deprioritised compared with the home columns). + - Dual-function modifiers on home row, mirrored on both hands. + - Dual-function layer change on thumbs. + - Layers are designed orthogonally with a single purpose per hand and are + accessed by holding a thumb key on the opposite hand. + - Holding layer change and modifiers on one hand combined with a single key + press on the other hand can produce any combination of modifiers and + single keys without any finger contortions. + - Single function mods are also defined on layers on the same hand as the + layer change thumb key so layer change and mods can be held in any order + or simultaneously without race conditions. + - As mods are only enabled on the opposite hand, auto-repeat is available on + the home row on layers for use with cursor and mouse keys. + - Tap-hold auto-repeat is disabled to enable faster tap-hold switching on + thumbs but thumb tap keys are mirrored onto some layers for use with + auto-repeat. + + +** Layers + +The layers are maintained in tables, with the thumb keys on the bottom row. NP +indicates the key is not present and is used to fill in the table around the +thumb keys. The grid arrangement of the tables does not imply a particular +physical layout. + +Basic keycodes are entered without the KC_ prefix. Symbols can be entered as-is +(excepting '"' (DQUO) and '|' (PIPE)). Empty cells are unused. + +The base layer has both halves of the layout joined for convenience. Other +layers are specified as a single hand. + +*** Base (BASE) + + +The base layer is maintained as separate tap and hold tables and are combined +into the corresponding tap-hold keycodes for mods and layer change. RST and +mods will be available on sub layers on the same hand as the layer change thumb +key. Unknown names are considered to be layer names. + +Base layer alphas are Colemak DHm. Thumb keys are backspace, enter, delete on +the right and space, tab, escape on the left. Dot, comma and apostrophe are +included for prose, dot and slash for file and directory names. + +#+NAME: tap +| Q | W | F | P | B | J | L | U | Y | ' | +| A | R | S | T | G | M | N | E | I | O | +| Z | X | C | D | V | K | H | , | . | / | +| NP | NP | ESC | SPC | TAB | ENT | BSPC | DEL | NP | NP | + +#+NAME: hold +| RST | | | | | | | | | RST | +| LGUI | LALT | LCTL | LSFT | | | LSFT | LCTL | LALT | LGUI | +| | | | | | | | | | | +| NP | NP | MEDR | NAVR | MOUR | NSSL | NSL | FUNL | NP | NP | + + +*** Navigation (NAVR) + +Primary right-hand layer (left home thumb) is navigation and editing. Cursor +keys are on the home position, line and page movement below, clipboard above, +caps and insert on the inner column. Thumb keys are duplicated from the base +layer to avoid having to layer change mid edit and to enable auto-repeat. + +#+NAME: navr +| AGIN | UNDO | CUT | COPY | PSTE | +| CAPS | LEFT | DOWN | UP | RGHT | +| INS | HOME | PGDN | PGUP | END | +| ENT | BSPC | DEL | NP | NP | + + +*** Mouse (MOUR) + +Secondary RH layer is mouse emulation. Mouse movement mirrors cursor navigation +on home and wheel mirrors line / page movement below. Buttons are on the +thumbs. Mouse movement, click, and drag with modifiers can be performed from +the home position. Unused keys are available for other related functions. + +#+NAME: mour +| | | | | | +| | MS_L | MS_D | MS_U | MS_R | +| | WH_L | WH_D | WH_U | WH_R | +| BTN3 | BTN1 | BTN2 | NP | NP | + + +*** Media (MEDR) + +Tertiary RH layer is media control, with volume up / down and next / prev +mirroring the navigation keys. Pause, stop and mute are on thumbs. Unused keys +are available for other related functions. + +#+NAME: medr +| | | | | | +| | MPRV | VOLD | VOLU | MNXT | +| | | | | | +| MSTP | MPLY | MUTE | NP | NP | + + +*** Numerals and Symbols (NSL) + +Primary left-hand layer (right home thumb) is numerals and symbols. Numerals +are in the standard numpad locations with symbols in the remaining positions. +Dot is duplicated from the base layer for convenience. + +#+NAME: nsl +| [ | 7 | 8 | 9 | ] | +| ; | 4 | 5 | 6 | = | +| ` | 1 | 2 | 3 | \ | +| NP | NP | . | 0 | - | + + +*** Shifted Numerals and Symbols (NSSL) + +Secondary LH layer has shifted symbols in the same locations to reduce chording +when using mods with shifted symbols. Automatically generated from unshifted +table. + + +*** Function and System (FUNL) + +Tertiary LH layer has function keys mirroring the numerals on the primary layer +with extras on the pinkie column, plus system keys on the inner column. App +(menu) is on the tertiary thumb key and other thumb keys are duplicated from the +base layer to enable auto-repeat. + + +#+NAME: funl +| F12 | F7 | F8 | F9 | PSCR | +| F11 | F4 | F5 | F6 | SLCK | +| F10 | F1 | F2 | F3 | PAUS | +| NP | NP | APP | SPC | TAB | + + +*** COMMENT Templates + +#+NAME: tem +| | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | +| | | | | | | | | | | +| | | | | | | | | | | +| NP | NP | | | | | | | NP | NP | + + +Duplicate base layer tap keys on thumbs rather than trans to enable auto-repeat. + +#+NAME: temr +| | | | | | +|------+------+------+------+------| +| | | | | | +| | | | | | +| | | | | | +| ENT | BSPC | DEL | NP | NP | + +#+NAME: teml +| | | | | | +|------+------+------+------+------| +| | | | | | +| | | | | | +| | | | | | +| NP | NP | ESC | SPC | TAB | + + +* Code Generation +:PROPERTIES: +:CUSTOM_ID: code-generation +:END: + +** Table Conversion Scripts + +*** table-layout-taphold + +Produce base layer from separate tap and hold tables. + +#+NAME: table-layout-taphold +#+BEGIN_SRC python :var tap_table=tap :var hold_table=hold :var symbol_names_table=symbol-names :var mods_list=mods :tangle no :results verbatim +width = 19 +mods_dict = dict.fromkeys(mods_list) +symbol_names_dict = {} +for symbol, name, shifted_symbol, shifted_name in symbol_names_table: + symbol_names_dict[symbol] = name + symbol_names_dict[shifted_symbol] = shifted_name +results = ' [BASE] = LAYOUT_miryoku(\n' +for tap_row, hold_row in map(None, tap_table, hold_table): + results += ' ' + for tap, hold in map(None, tap_row, hold_row): + if tap == '': + code = 'NU' + elif tap in symbol_names_dict: + code = symbol_names_dict[tap] + else: + code = tap + code = 'KC_' + str(code) + if hold in mods_dict: + code = str(hold) + '_T(' + code + ')' + elif hold != '' and hold != 'NP' and hold != 'RST': + code = 'LT(' + str(hold) + ', ' + code + ')' + results += (code + ', ').ljust(width) + results = results.rstrip(' ') + '\n' +results = results.rstrip('\n, ') + '\n )' +return results +#+END_SRC + +#+RESULTS: table-layout-taphold +: [BASE] = LAYOUT_miryoku( +: KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, +: LGUI_T(KC_A), LALT_T(KC_R), LCTL_T(KC_S), LSFT_T(KC_T), KC_G, KC_M, LSFT_T(KC_N), LCTL_T(KC_E), LALT_T(KC_I), LGUI_T(KC_O), +: KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, +: KC_NP, KC_NP, LT(MEDR, KC_ESC), LT(NAVR, KC_SPC), LT(MOUR, KC_TAB), LT(NSSL, KC_ENT), LT(NSL, KC_BSPC), LT(FUNL, KC_DEL), KC_NP, KC_NP +: ) + + +*** table-layout-half + +Produce sub layers given layer name and corresponding table for single hand and +incorporating mods and reset from base layer. Layer names must end with R or L. +A layer with shifted symbols can also be generated. + +#+NAME: table-layout-half +#+BEGIN_SRC python :var hold_table=hold :var layer_name="NSL" :var half_table=nsl :var symbol_names_table=symbol-names :var mods_list=mods :var shift="false" :tangle no :results verbatim +width = 9 +mods_dict = dict.fromkeys(mods_list) +symbol_names_dict = {} +shifted_symbol_names_dict = {} +for symbol, name, shifted_symbol, shifted_name in symbol_names_table: + symbol_names_dict[symbol] = name + symbol_names_dict[shifted_symbol] = shifted_name + shifted_symbol_names_dict[symbol] = shifted_name +length = len(half_table[0]) +mode = layer_name[-1:].lower() +results = ' [' + layer_name + '] = LAYOUT_miryoku(\n' +for half_row, hold_row in map(None, half_table, hold_table): + results += ' ' + hold_row_l, hold_row_r = hold_row[:length], hold_row[length:] + for lr, hold_row_lr in ('l', hold_row_l), ('r', hold_row_r): + if lr == mode: + for half in half_row: + if half == '': + code = 'NU' + elif shift == "true" and half in shifted_symbol_names_dict: + code = shifted_symbol_names_dict[half] + elif half in symbol_names_dict: + code = symbol_names_dict[half] + else: + code = half + results += ('KC_' + str(code) + ', ').ljust(width) + else: + for hold in hold_row_lr: + if hold == '' or hold != 'NP' and hold != 'RST' and hold not in mods_dict: + code = 'NA' + else: + code = hold + results += ('KC_' + str(code) + ', ').ljust(width) + results = results.rstrip(' ') + '\n' +results = results.rstrip('\n, ') + '\n )' +return results +#+END_SRC + +#+RESULTS: table-layout-half +: [NSL] = LAYOUT_miryoku( +: KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, KC_NA, KC_NA, KC_NA, KC_NA, KC_RST, +: KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, KC_NA, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, +: KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, KC_NA, KC_NA, KC_NA, KC_NA, KC_NA, +: KC_NP, KC_NP, KC_DOT, KC_0, KC_MINS, KC_NA, KC_NA, KC_NA, KC_NP, KC_NP +: ) + + +*** table-enums + +Produce layer enums from layer names in hold table. + +#+NAME: table-enums +#+BEGIN_SRC python :var hold_table=hold :var mods_list=mods :tangle no +mods_dict = dict.fromkeys(mods_list) +results = 'enum layers { BASE, ' +for hold_row in hold_table: + for hold in hold_row: + if hold not in mods_dict and hold != '' and hold != 'NP' and hold != 'RST': + results += hold + ', ' +results = results.rstrip(', ') + ' };' +return results +#+END_SRC + +#+RESULTS: table-enums +: enum layers { BASE, MEDR, NAVR, MOUR, NSSL, NSL, FUNL }; + + +** Data + +*** symbol-names + +Symbol, name, and shifted symbol mappings for use in tables. + +#+NAME: symbol-names +| ` | GRV | ~ | TILD | +| - | MINS | _ | UNDS | +| = | EQL | + | PLUS | +| [ | LBRC | { | LCBR | +| ] | RBRC | } | RCBR | +| \ | BSLS | PIPE | PIPE | +| ; | SCLN | : | COLN | +| ' | QUOT | DQUO | DQUO | +| , | COMM | < | LT | +| . | DOT | > | GT | +| / | SLSH | ? | QUES | +| 1 | 1 | ! | EXLM | +| 2 | 2 | @ | AT | +| 3 | 3 | # | HASH | +| 4 | 4 | $ | DLR | +| 5 | 5 | % | PERC | +| 6 | 6 | ^ | CIRC | +| 7 | 7 | & | AMPR | +| 8 | 8 | * | ASTR | +| 9 | 9 | ( | LPRN | +| 0 | 0 | ) | RPRN | + + +*** mods + +Modifiers usable in hold table. Need to have the same name for KC_ and _T versions. + +#+NAME: mods +- LSFT +- LCTL +- LALT +- LGUI +- LAGR + + +** Other + +*** header + +Header for tangled src files. + +#+NAME: header +#+BEGIN_SRC C :tangle no +generated from users/manna-harbour_miryoku/miryoku.org +#+END_SRC + + +* Subset Mapping +:PROPERTIES: +:CUSTOM_ID: subset-mapping +:END: + +** Userspace + +The keymap and configuration are shared between keyboards. The keymap is +defined for LAYOUT_miryoku which is 10x4, with the outer 2 positions on the +bottom row unused and the rest of the bottom row are the thumb keys. + + +*** manna-harbour_miryoku.c + +Contains the keymap. Included from keymap.c + +[[./manna-harbour_miryoku.c][users/manna-harbour_miryoku/manna-harbour_miryoku.c]] +#+BEGIN_SRC C :noweb yes :tangle manna-harbour_miryoku.c + +// <
> + +#include QMK_KEYBOARD_H + +#define KC_NP KC_NO // key is not present +#define KC_NA KC_NO // present but not available for use +#define KC_NU KC_NO // available but not used +#define KC_RST RESET + +<> + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +<>, +<>, +<>, +<>, +<>, +<>, +<> +}; +#+END_SRC + + +*** config.h + +Config options. Automatically included. + +[[./config.h][users/manna-harbour_miryoku/config.h]] +#+BEGIN_SRC C :noweb yes :tangle config.h + +// <
> + +#pragma once + +// Prevent normal rollover on alphas from accidentally triggering mods. +#define IGNORE_MOD_TAP_INTERRUPT + +// Enable rapid switch from tap to hold, disables double tap hold auto-repeat. +#define TAPPING_FORCE_HOLD + +// Recommended for heavy chording. +#define QMK_KEYS_PER_SCAN 4 + +#+END_SRC + + +*** rules.mk + +Build options. Automatically included. + +[[./rules.mk][users/manna-harbour_miryoku/rules.mk]] +#+BEGIN_SRC makefile :noweb yes :tangle rules.mk + +# <
> + +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) + +#+END_SRC + + +** Layouts + +To use the keymap on a keyboard supporting the layouts feature, LAYOUT_miryoku +is defined as a macro mapping onto the layout's own LAYOUT macro, leaving the +unused keys as KC_NO. The userspace keymap is then included. + +*** ergodox + +For the ergodox layout, the main 5x3 alphas are used as usual. The primary and +secondary thumb keys are the inner and outer 2u thumb keys and the tertiary +thumb key is the innermost key of the partial bottom row. The remaining keys +are unused. + +[[../../layouts/community/ergodox/manna-harbour_miryoku/keymap.c][layouts/community/ergodox/manna-harbour_miryoku/keymap.c]] +#+BEGIN_SRC C :noweb yes :tangle ../../layouts/community/ergodox/manna-harbour_miryoku/keymap.c + +// <
> + +#define LAYOUT_miryoku(\ +K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ +K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ +K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ +N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ +)\ +LAYOUT_ergodox_pretty( \ +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ +KC_NO, K00, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, K09, KC_NO, \ +KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, \ +KC_NO, K20, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K29, KC_NO, \ +KC_NO, KC_NO, KC_NO, KC_NO, K32, K37, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, \ + K33, K34, KC_NO, KC_NO, K35, K36 \ +) + +#include "manna-harbour_miryoku.c" + +#+END_SRC + +To build for any keyboard using the this layout (ergodone, ergodox_ez, +ergodox_infinity, hotdox) e.g. the ergodox_ez, + +#+BEGIN_SRC sh :tangle no +cd ../.. && make ergodox_ez:manna-harbour_miryoku:teensy +#+END_SRC + + + +*** ortho_4x12 + +For the ortho_4x12 layout, the right half as is as follows: The rightmost column +bottom 3 rows is the pinkie column. The middle 4 columns top 3 rows are for the +remaining fingers. The bottom row left 3 columns are the thumb keys. The +remaining keys are unused. + +[[../../layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c][layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c]] +#+BEGIN_SRC C :noweb yes :tangle ../../layouts/community/ortho_4x12/manna-harbour_miryoku/keymap.c + +// <
> + +#define LAYOUT_miryoku(\ +K00, K01, K02, K03, K04, K05, K06, K07, K08, K09,\ +K10, K11, K12, K13, K14, K15, K16, K17, K18, K19,\ +K20, K21, K22, K23, K24, K25, K26, K27, K28, K29,\ +N30, N31, K32, K33, K34, K35, K36, K37, N38, N39\ +)\ +LAYOUT_ortho_4x12(\ +KC_NO, K01, K02, K03, K04, KC_NO, KC_NO, K05, K06, K07, K08, KC_NO,\ +K00, K11, K12, K13, K14, KC_NO, KC_NO, K15, K16, K17, K18, K09,\ +K10, K21, K22, K23, K24, KC_NO, KC_NO, K25, K26, K27, K28, K19,\ +K20, KC_NO, KC_NO, K32, K33, K34, K35, K36, K37, KC_NO, KC_NO, K29\ +) + +#include "manna-harbour_miryoku.c" + +#+END_SRC + +To build for any keyboard using this layout (4x4, nori, chimera_ls, contra, +divergetm2, jj40, lets_split, lets_split_eh, meira, niu_mini, planck, telophase, +vitamins_included, zinc, zlant, ortho48, kbd4x, levinson, wavelet, plaid) +e.g. the levinson, + +#+BEGIN_SRC sh :tangle no +make keebio/levinson:manna-harbour_miryoku:avrdude +#+END_SRC + + +** Keyboards + +To use the keymap on a keyboard which does not support the layouts feature, +LAYOUT_miryoku is defined as a macro mapping onto the keyboard's own LAYOUT +macro, leaving the unused keys as KC_NO. The userspace keymap is then included. + + +*** crkbd + +The outer columns are unused. + +[[../../keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c][keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c]] +#+BEGIN_SRC C :noweb yes :tangle ../../keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c + +// <
> + +#define LAYOUT_miryoku( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ + N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \ +) \ +LAYOUT( \ +KC_NO, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_NO, \ +KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, \ +KC_NO, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO, \ + K32, K33, K34, K35, K36, K37 \ +) + +#include "manna-harbour_miryoku.c" + +#+END_SRC + +To build for this keyboard, + +#+BEGIN_SRC sh :tangle no +cd ../.. && make crkbd:manna-harbour_miryoku:avrdude +#+END_SRC + + +* Related Documentation + +** QMK + +- https://qmk.fm/ +- https://docs.qmk.fm/#/getting_started_introduction +- https://docs.qmk.fm/#/hardware_keyboard_guidelines +- https://docs.qmk.fm/#/config_options +- https://docs.qmk.fm/#/keycodes +- https://docs.qmk.fm/#/feature_advanced_keycodes +- https://docs.qmk.fm/#/feature_layouts +- https://docs.qmk.fm/#/feature_userspace +- https://docs.qmk.fm/#/getting_started_make_guide + + +** Org Mode + +- https://orgmode.org/ +- https://orgmode.org/manual/Tables.html +- https://orgmode.org/manual/Working-with-Source-Code.html diff --git a/users/manna-harbour_miryoku/rules.mk b/users/manna-harbour_miryoku/rules.mk new file mode 100644 index 000000000..baff1431f --- /dev/null +++ b/users/manna-harbour_miryoku/rules.mk @@ -0,0 +1,5 @@ + +# generated from users/manna-harbour_miryoku/miryoku.org + +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -- cgit v1.2.3 From 06ba968759041d8c6dfe1309888d21bdbc16cd24 Mon Sep 17 00:00:00 2001 From: Matthew Lyon Date: Mon, 8 Jul 2019 06:27:30 -0700 Subject: mattly's userspace and iris (#6279) --- users/mattly/config.h | 9 ++++++ users/mattly/mattly.c | 70 ++++++++++++++++++++++++++++++++++++++++++ users/mattly/mattly.h | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ users/mattly/readme.md | 10 ++++++ users/mattly/rules.mk | 2 ++ 5 files changed, 174 insertions(+) create mode 100644 users/mattly/config.h create mode 100644 users/mattly/mattly.c create mode 100644 users/mattly/mattly.h create mode 100644 users/mattly/readme.md create mode 100644 users/mattly/rules.mk (limited to 'users') diff --git a/users/mattly/config.h b/users/mattly/config.h new file mode 100644 index 000000000..25d379801 --- /dev/null +++ b/users/mattly/config.h @@ -0,0 +1,9 @@ +#pragma once + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 diff --git a/users/mattly/mattly.c b/users/mattly/mattly.c new file mode 100644 index 000000000..1e61e0126 --- /dev/null +++ b/users/mattly/mattly.c @@ -0,0 +1,70 @@ +#include "mattly.h" + +__attribute__ ((weak)) +layer_state_t layer_state_set_keymap (layer_state_t state) { + return state; +} + +void set_lights_default(void) { + #ifdef RGBLIGHT_ENABLE + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + rgblight_sethsv_noeeprom(HSV_CAPS); + } else { + rgblight_sethsv_noeeprom(HSV_DEFAULT); + } + #endif +} + +void layer_state_set_rgb(layer_state_t state) { +#ifdef RGBLIGHT_ENABLE + switch (biton32(state)) { + case _QWERTY: + set_lights_default(); + break; + case _SYMBOL: + rgblight_sethsv_noeeprom(HSV_SYMBOL); + break; + case _NAVNUM: + rgblight_sethsv_noeeprom(HSV_NAVNUM); + break; + case _FUNCT: + rgblight_sethsv_noeeprom(HSV_FUNCT); + break; + } +#endif +} + + +layer_state_t layer_state_set_user (layer_state_t state) { + state = update_tri_layer_state(state, _SYMBOL, _NAVNUM, _FUNCT); + layer_state_set_rgb(state); + return layer_state_set_keymap (state); +} + +void on_reset(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_sethsv_noeeprom(HSV_RESET); + #endif +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_CAPS: + #ifdef RGBLIGHT_ENABLE + set_lights_default(); + #endif + return true; + case RESET: + on_reset(); + return true; + default: + return true; + } +} + +void keyboard_post_init_user(void) { +#ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + set_lights_default(); +#endif +} diff --git a/users/mattly/mattly.h b/users/mattly/mattly.h new file mode 100644 index 000000000..08318840d --- /dev/null +++ b/users/mattly/mattly.h @@ -0,0 +1,83 @@ +/* Copyright 2019 Matthew Lyon + * + * 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 . + */ + +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +enum { + _QWERTY, + _NAVNUM, + _SYMBOL, + _FUNCT, +}; + +// left hand +#define ESC_HYP MT(MOD_HYPR, KC_ESC) +#define BSP_NUM LT(_NAVNUM, KC_BSPC) +#define ENT_SFT MT(MOD_LSFT, KC_ENT) +#define SPC_SFT MT(MOD_LSFT, KC_SPC) + +// right hand +#define SPC_SFT MT(MOD_LSFT, KC_SPC) +#define TAB_SYM LT(_SYMBOL, KC_TAB) +#define DEL_WRP MT(MOD_LCTL | MOD_LALT | MOD_LGUI, KC_DEL) + +#define NAVLOCK TG(_NAVNUM) +#define SYMLOCK TG(_SYMBOL) + + +// QWERTY + +#define A_CTRL MT(MOD_LCTL, KC_A) +#define S_ALT MT(MOD_LALT, KC_S) +#define D_GUI MT(MOD_LGUI, KC_D) +#define F_SHFT MT(MOD_LSFT, KC_F) +#define J_SHFT MT(MOD_RSFT, KC_J) +#define K_GUI MT(MOD_RGUI, KC_K) +#define L_ALT MT(MOD_RALT, KC_L) +#define MINSCTL MT(MOD_RCTL, KC_MINS) + +#define BWORD LALT(KC_LEFT) +#define FWORD LALT(KC_RIGHT) + +// OS X default keys +#define NWIN LGUI(KC_GRV) // Next Window +#define PWIN LGUI(LSFT(KC_GRV)) // Prev Window +#define NTAB LGUI(LSFT(KC_RBRC)) // Next Tab +#define PTAB LGUI(LSFT(KC_LBRC)) // Prev Tab +#define NAVBACK LGUI(KC_LBRC) // Navigate Forward +#define NAVFWD LGUI(KC_RBRC) // Navigate Back + +// my personal mappings to window manager commands +#define XALLWIN HYPR(KC_F14) +#define XDESKTP HYPR(KC_F15) +#define XNXTSPC HYPR(KC_F16) +#define XPRVSPC HYPR(KC_F17) +#define XNOTIFY HYPR(KC_F18) + +#ifdef RGBLIGHT_ENABLE +#define HSV_CAPS 42, 255, 255 +#define HSV_DEFAULT 30, 218, 255 +#define HSV_SYMBOL 22, 255, 255 +#define HSV_NAVNUM 245, 200, 255 +#define HSV_FUNCT 233, 255, 255 +#define HSV_RESET 180, 255, 255 +#endif + +#endif + diff --git a/users/mattly/readme.md b/users/mattly/readme.md new file mode 100644 index 000000000..356992534 --- /dev/null +++ b/users/mattly/readme.md @@ -0,0 +1,10 @@ +# mattly's layouts + +My layouts are based around: + +* making the most from small layouts on keyboards like the iris or planck +* moving held-modifiers from pinkies to thumbs or home row, giving many keys dual purposes via mod/layer taps +* easy home-row navigation on a layer, using standard keys, available to all programs, not just a specially-configured editor +* easy access to punctuation symbols used in the programming languages I work in + +[Here is an image](https://lyonheart.us/etc/mattly-keymap.png) with an outdated description of my keymap \ No newline at end of file diff --git a/users/mattly/rules.mk b/users/mattly/rules.mk new file mode 100644 index 000000000..6803d361d --- /dev/null +++ b/users/mattly/rules.mk @@ -0,0 +1,2 @@ +SRC += mattly.c +MOUSEKEY_ENABLE = yes -- cgit v1.2.3 From 220873dfebaac06f4686f619622babcd40bc54a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 9 Jul 2019 15:52:23 +0200 Subject: [Keymap] Add personal Wasdat keymap, update other keymaps (#6290) * Add wasdat:konstantin keymap TODO: Move it to layouts/ * Use HHKB arrow arrangement for mouse keys on KBD6X * Move KC_APP from Ctrl to M on all boards * Use RCT_RSF on Melody96 * Set TAP_HOLD_CAPS_DELAY to 50 in userspace * Use RSF_RCT instead of RCT_RSF --- users/konstantin/config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'users') diff --git a/users/konstantin/config.h b/users/konstantin/config.h index 4ca19f824..4edab2baa 100644 --- a/users/konstantin/config.h +++ b/users/konstantin/config.h @@ -14,8 +14,9 @@ #define NO_ACTION_ONESHOT #define PERMISSIVE_HOLD -#define TAPPING_TERM 200 -#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 +#define TAP_HOLD_CAPS_DELAY 50 #define UNICODE_CYCLE_PERSIST false #define UNICODE_SELECTED_MODES UC_WINC, UC_WIN, UC_LNX -- cgit v1.2.3 From 38fdf7a2d2f3f0bb9c21332b81a289de94b9870a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Fri, 12 Jul 2019 15:16:28 +0200 Subject: [Keymap] Add missing tap dance action and fix RGB hues in personal keymaps (#6312) * Add missing TD_RSF_RCT tap dance * Use standard QMK HSV and RGB structs, fix Godspeed colors * Move PROGMEM after the type in RGB intervals * Add MODERN_DOLCH_RED color, use it on KBD6X * Use 255 instead of RGBLIGHT_LIMIT_VAL in color definitions * Remove IS_COMMAND override on Whitefox --- users/konstantin/rgb.c | 15 ++++++++------- users/konstantin/rgb.h | 17 +++-------------- users/konstantin/tap_dance.c | 1 + users/konstantin/tap_dance.h | 2 ++ 4 files changed, 14 insertions(+), 21 deletions(-) (limited to 'users') diff --git a/users/konstantin/rgb.c b/users/konstantin/rgb.c index 0f0c73c49..a96cad019 100644 --- a/users/konstantin/rgb.c +++ b/users/konstantin/rgb.c @@ -1,24 +1,25 @@ #include "rgb.h" #ifdef RGBLIGHT_EFFECT_BREATHING -const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {20, 30, 5, 10}; +const uint8_t PROGMEM RGBLED_BREATHING_INTERVALS[] = { 20, 30, 5, 10 }; #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD -const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {20, 50, 100}; +const uint8_t PROGMEM RGBLED_RAINBOW_MOOD_INTERVALS[] = { 20, 50, 100 }; #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL -const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 50, 100}; +const uint8_t PROGMEM RGBLED_RAINBOW_SWIRL_INTERVALS[] = { 20, 50, 100 }; #endif #ifdef RGBLIGHT_EFFECT_SNAKE -const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {20, 50, 100}; +const uint8_t PROGMEM RGBLED_SNAKE_INTERVALS[] = { 20, 50, 100 }; #endif #ifdef RGBLIGHT_EFFECT_KNIGHT -const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {20, 50, 100}; +const uint8_t PROGMEM RGBLED_KNIGHT_INTERVALS[] = { 20, 50, 100 }; #endif -const hsv_t GODSPEED_BLUE = { .h = 280, .s = 68, .v = RGBLIGHT_LIMIT_VAL }; -const hsv_t GODSPEED_YELLOW = { .h = 38, .s = 153, .v = RGBLIGHT_LIMIT_VAL }; +const HSV GODSPEED_BLUE = { .h = 198, .s = 68, .v = 255 }; +const HSV GODSPEED_YELLOW = { .h = 27, .s = 153, .v = 255 }; +const HSV MODERN_DOLCH_RED = { .h = 252, .s = 255, .v = 144 }; diff --git a/users/konstantin/rgb.h b/users/konstantin/rgb.h index aed855aa0..36a9d9cd7 100644 --- a/users/konstantin/rgb.h +++ b/users/konstantin/rgb.h @@ -2,17 +2,6 @@ #include "quantum.h" -typedef struct { - uint16_t h; // 0–360 - uint8_t s; // 0–255 - uint8_t v; // 0–255 -} hsv_t; - -typedef struct { - uint8_t r; // 0–255 - uint8_t g; // 0–255 - uint8_t b; // 0–255 -} rgb_t; - -extern const hsv_t GODSPEED_BLUE; -extern const hsv_t GODSPEED_YELLOW; +extern const HSV GODSPEED_BLUE; +extern const HSV GODSPEED_YELLOW; +extern const HSV MODERN_DOLCH_RED; diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c index fa43288ce..ba1453fc0 100644 --- a/users/konstantin/tap_dance.c +++ b/users/konstantin/tap_dance.c @@ -110,6 +110,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_LALT), [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI), [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT), + [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RSFT, KC_RCTL), [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN), [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN), diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h index 13d682a60..d2f00c8cb 100644 --- a/users/konstantin/tap_dance.h +++ b/users/konstantin/tap_dance.h @@ -7,6 +7,7 @@ #define RAL_LAL TD(TD_RAL_LAL) #define RAL_RGU TD(TD_RAL_RGU) #define RCT_RSF TD(TD_RCT_RSF) +#define RSF_RCT TD(TD_RSF_RCT) #define LSFT_FN TD(TD_LSFT_FN) #define RCTL_FN TD(TD_RCTL_FN) @@ -18,6 +19,7 @@ enum tap_dance { TD_RAL_LAL, TD_RAL_RGU, TD_RCT_RSF, + TD_RSF_RCT, TD_LSFT_FN, TD_RCTL_FN, -- cgit v1.2.3 From cf215487ba35c6754cd1c52bb900a46bb52ed3a3 Mon Sep 17 00:00:00 2001 From: Ryan Caltabiano Date: Sun, 19 May 2019 23:12:29 -0500 Subject: Switching rgb_config_t to use HSV struct --- users/xulkal/custom_oled.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'users') diff --git a/users/xulkal/custom_oled.c b/users/xulkal/custom_oled.c index d871e96f0..7280ef701 100644 --- a/users/xulkal/custom_oled.c +++ b/users/xulkal/custom_oled.c @@ -80,7 +80,7 @@ static void render_status(void) oled_set_cursor(0, oled_max_lines() - 7); oled_write_P(PSTR("-----"), false); static char buffer[26] = {0}; - snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val, rgb_matrix_config.speed, rgb_matrix_config.mode); + snprintf(buffer, sizeof(buffer), "h%3d s%3d v%3d s%3d m%3d\n", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, rgb_matrix_config.speed, rgb_matrix_config.mode); oled_write(buffer, false); #elif defined(RGBLIGHT_ENABLE) oled_set_cursor(0, oled_max_lines() - 7); @@ -137,7 +137,7 @@ static void render_status(void) #if defined(RGB_MATRIX_ENABLE) static char buffer[20] = {0}; - snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val); + snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); oled_write(buffer, false); #elif defined(RGBLIGHT_ENABLE) static char buffer[20] = {0}; -- cgit v1.2.3