1
0
Fork 0

update pvinis keymap (#8746)

* update a bunch of stuff

Better rules, better config, added encoders, lights, audio.

* some fmt

* more fmt
This commit is contained in:
Pavlos Vinieratos 2020-04-13 20:59:04 +02:00 committed by GitHub
parent 6fb048fdaf
commit f6b40da7f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 620 additions and 481 deletions

View file

@ -1,38 +1,36 @@
// pvinis ergodox ez // pvinis ergodox ez
// ,------------------------------------. ,------------------------------------. // ,------------------------------------. ┌────┬────┬────┬────┬────┬────┬──────┐
// | | | | | | | | | | | | | | | | // | | | | | | | | │ │ │ │ │ │ │ │
// |------+----+----+----+----+---------| |----+----+----+----+----+----+------| // |------+----+----+----+----+---------| ├────┼────┼────┼────┼────┼────┼──────┤
// | | | | | | | | | | | | | | | | // | | | | | | | | │ │ │ │ │ │ │ │
// |------+----+----+----x----x----| | | |----x----x----+----+----+------| // |------+----+----+----x----x----| | │ ├────╆━━━━╅────┼────┼────┼──────┤
// | | | | | | |----| |----| | | | | | | // | | | | | | |----| ├────┤ ┃ ┃ │ │ │ │
// |------+----+----+----x----x----| | | |----x----x----+----+----+------| // |------+----+----+----x----x----| | │ ├────╄━━━━╃────┼────┼────┼──────┤
// | | | | | | | | | | | | | | | | // | | | | | | | | │ │ │ │ │ │ │ │
// `------+----+----+----+----+---------' `---------+----+----+----+----+------' // `------+----+----+----+----+---------' └────┴────┼────┼────┼────┼────┼────┬─┘
// | | | | | | | | | | | | // | | | | | | │ │ │ │ │ │
// `------------------------' `------------------------' // `------------------------' └────┴────┴────┴────┴────┘
// ,---------. ,---------. // ,---------. ┌────┬────┐
// | | | | | | // | | | │ │ │
// ,----+----+----| |----+----+----. // ,----+----+----| ├────┼────┼────┐
// | | | | | | | | // | | | | │ │ │ │
// | | |----| |----| | | // | | |----| ├────┤ │ │
// | | | | | | | | // | | | | │ │ │ │
// `--------------' `--------------' // `--------------' └────┴────┴────┘
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "pvinis.h" #include "pvinis.h"
#include "mousekey.h" #include "mousekey.h"
// layers // layers
enum { enum {
MOUSE = 8, MOUSE = 8,
}; };
// extra keys // extra keys
enum { enum {
NONE = 30, NONE = 30,
TD_LAYR, // SYSCTL and MOUSE layer switch TD_LAYR, // SYSCTL and MOUSE layer switch
}; };
// application selection // application selection
@ -41,158 +39,170 @@ enum {
#define AP_XCOD ALLM(KC_X) #define AP_XCOD ALLM(KC_X)
#define AP_MSGR ALLM(KC_M) #define AP_MSGR ALLM(KC_M)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ,------------------------------------. ,------------------------------------. // ,------------------------------------. ,------------------------------------.
// |4xFLSH| | | | | |Opt | | | | | | | | | // |4xFLSH| | | | | |Opt | | | | | | | | |
// |------+----+----+----+----+---------| |----+----+----+----+----+----+------| // |------+----+----+----+----+---------| |----+----+----+----+----+----+------|
// | Tab | | | | | | | | | | | | | | | // | Tab | | | | | | | | | | | | | | |
// |------+----+----+----x----x----| | | |----x----x----+----+----+------| // |------+----+----+----x----x----| | | |----x----x----+----+----+------|
// |EscCtl| | | | | |----| |----| | | | | | Ent | // |EscCtl| | | | | |----| |----| | | | | | Ent |
// |------+----+----+----x----x----| | | |----x----x----+----+----+------| // |------+----+----+----x----x----| | | |----x----x----+----+----+------|
// |LShift| | | | | | | | | | | | | |RShift| // |LShift| | | | | | | | | | | | | |RShift|
// `------+----+----+----+----+---------' `---------+----+----+----+----+------' // `------+----+----+----+----+---------' `---------+----+----+----+----+------'
// | | | | |Cmd | | | | | | | // | | | |Cmd |LOWR| |RASE|RAlt| | | |
// `------------------------' `------------------------' // `------------------------' `------------------------'
// ,---------. ,---------. // ,---------. ,---------.
// |QWER| | | | | // |QWER| | | | |
// ,----+----+----| |----+----+----. // ,----+----+----| |----+----+----.
// | Ba | L | | | | | | // | Ba | L | | | | | |
// | ck |Shi |----| |----| |Spc | // | ck |Shi |----| |----| |Spc |
// | spc| ft | | | | | | // | spc| ft | | | | | |
// `--------------' `--------------' // `--------------' `--------------'
[LR_BASE] = LAYOUT_ergodox_pretty_wrapper( [LR_BASE] = LAYOUT_ergodox_pretty_wrapper(
TD_3FLS, _______, _______, _______, _______, _______, KC_LALT, _______, _______, _______, _______, _______, _______, _______, // clang-format off
KC_TAB , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TD_3FLS, _______, _______, _______, _______, _______, KC_LALT, _______, _______, _______, _______, _______, _______, _______,
PV_ESCC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT , KC_TAB , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, PV_ESCC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT ,
_______, _______, _______, KC_LGUI, SYMBOL , SYSCTL , KC_RALT, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,
QWERTY , CARPALX, _______, _______, _______, _______, _______, KC_LGUI, SYMBOL , SYSCTL , KC_RALT, _______, _______, _______,
_______, _______, QWERTY , CARPALX, _______, _______,
KC_BSPC, _______, _______, _______, _______, KC_SPC _______, _______,
KC_BSPC, _______, _______, _______, _______, KC_SPC
// clang-format on
),
// ,------------------------------------. ,------------------------------------.
// | | NUMBERS_L | | | - | NUMBERS_R | = |
// |------+----+----+----+----+---------| |----+----+----+----+----+----+------|
// | | | [ | | ] | | |
// |------+ | | | | +------|
// | | QWERTY_L |----| |----| QWERTY_R | |
// |------+ | ( | | ) | +------|
// | | | | | | | |
// `------+----+----+----+----+---------' `---------+----+----+----+----+------'
// | | ` | | | | | | | | ' | |
// `------------------------' `------------------------'
// ,---------. ,---------.
// | | | | | |
// ,----+----+----| |----+----+----.
// | | | | | | | |
// | | |----| |----| | |
// | | | | | | | |
// `--------------' `--------------'
// See `users/pvinis/pvinis.h`
[LR_QWERTY] = LAYOUT_ergodox_pretty_wrapper(
// clang-format off
_______, ________________NUMBERS_L__________________, _______, KC_MINS, ________________NUMBERS_R__________________, KC_EQL ,
_______, _________________QWERTY_L1_________________, KC_LBRC, KC_RBRC, _________________QWERTY_R1_________________, _______,
_______, _____________MOD_QWERTY_L2_________________, _____________MOD_QWERTY_R2_________________, _______,
_______, _________________QWERTY_L3_________________, KC_LPRN, KC_RPRN, _________________QWERTY_R3_________________, _______,
_______, KC_GRV, _______, _______, _______, _______, _______, _______, KC_QUOT , _______,
_______, _______, _______, _______,
_______, _______,
_______, _______, _______, _______, _______, _______
// clang-format off
), ),
// ,------------------------------------. ,------------------------------------. // ,------------------------------------. ,------------------------------------.
// | | NUMBERS_L | | | - | NUMBERS_R | = | // | | NUMBERS_L | | | | NUMBERS_R | |
// |------+----+----+----+----+---------| |----+----+----+----+----+----+------| // |------+----+----+----+----+---------| |----+----+----+----+----+----+------|
// | | | [ | | ] | | | // | | | | | | | |
// |------+ | | | | +------| // |------+ | | | | +------|
// | | QWERTY_L |----| |----| QWERTY_R | | // | | CARPALX_L |----| |----| CARPALX_R | |
// |------+ | ( | | ) | +------| // |------+ | | | | +------|
// | | | | | | | | // | | | | | | | |
// `------+----+----+----+----+---------' `---------+----+----+----+----+------' // `------+----+----+----+----+---------' `---------+----+----+----+----+------'
// | | ` | | | | | | | | ' | | // | | | | | | | | | | | |
// `------------------------' `------------------------' // `------------------------' `------------------------'
// ,---------. ,---------. // ,---------. ,---------.
// | | | | | | // | | | | | |
// ,----+----+----| |----+----+----. // ,----+----+----| |----+----+----.
// | | | | | | | | // | | | | | | | |
// | | |----| |----| | | // | | |----| |----| | |
// | | | | | | | | // | | | | | | | |
// `--------------' `--------------' // `--------------' `--------------'
// See `users/pvinis/pvinis.h` // See `users/pvinis/pvinis.h`
[LR_QWERTY] = LAYOUT_ergodox_pretty_wrapper(
_______, ________________NUMBERS_L__________________, _______, KC_MINS, ________________NUMBERS_R__________________, KC_EQL ,
_______, _________________QWERTY_L1_________________, KC_LBRC, KC_RBRC, _________________QWERTY_R1_________________, _______,
_______, _____________MOD_QWERTY_L2_________________, _____________MOD_QWERTY_R2_________________, _______,
_______, _________________QWERTY_L3_________________, KC_LPRN, KC_RPRN, _________________QWERTY_R3_________________, _______,
_______, KC_GRV, _______, _______, _______, _______, _______, _______, KC_QUOT , _______,
_______, _______, _______, _______,
_______, _______,
_______, _______, _______, _______, _______, _______
),
// ,------------------------------------. ,------------------------------------.
// | | NUMBERS_L | | | | NUMBERS_R | |
// |------+----+----+----+----+---------| |----+----+----+----+----+----+------|
// | | | | | | | |
// |------+ | | | | +------|
// | | CARPALX_L |----| |----| CARPALX_R | |
// |------+ | | | | +------|
// | | | | | | | |
// `------+----+----+----+----+---------' `---------+----+----+----+----+------'
// | | | | | | | | | | | |
// `------------------------' `------------------------'
// ,---------. ,---------.
// | | | | | |
// ,----+----+----| |----+----+----.
// | | | | | | | |
// | | |----| |----| | |
// | | | | | | | |
// `--------------' `--------------'
// See `users/pvinis/pvinis.h`
[LR_CARPALX] = LAYOUT_ergodox_pretty_wrapper( [LR_CARPALX] = LAYOUT_ergodox_pretty_wrapper(
_______, ________________NUMBERS_L__________________, _______, _______, ________________NUMBERS_R__________________, _______, // clang-format off
_______, ________________CARPALX_L1_________________, _______, _______, ________________CARPALX_R1_________________, _______, _______, ________________NUMBERS_L__________________, _______, _______, ________________NUMBERS_R__________________, _______,
_______, ________________CARPALX_L2_________________, ________________CARPALX_R2_________________, _______, _______, ________________CARPALX_L1_________________, _______, _______, ________________CARPALX_R1_________________, _______,
_______, ________________CARPALX_L3_________________, _______, _______, ________________CARPALX_R3_________________, _______, _______, ________________CARPALX_L2_________________, ________________CARPALX_R2_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________CARPALX_L3_________________, _______, _______, ________________CARPALX_R3_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______ _______, _______,
_______, _______, _______, _______, _______, _______
// clang-format on
),
// See `users/pvinis/pvinis.h`
[LR_SYMBOL] = LAYOUT_ergodox_pretty_wrapper(
// clang-format off
_______, ______________________F_L__________________, KC_F11 , KC_F12 , ______________________F_R__________________, _______,
_______, _________________SYMBOL_L1_________________, _______, _______, _________________SYMBOL_R1_________________, _______,
_______, _________________SYMBOL_L2_________________, _________________SYMBOL_R2_________________, _______,
_______, _________________SYMBOL_L3_________________, _______, _______, _________________SYMBOL_R3_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______,
_______, _______, _______, _______, _______, _______
// clang-format off
), ),
// See `users/pvinis/pvinis.h` // See `users/pvinis/pvinis.h`
[LR_SYMBOL] = LAYOUT_ergodox_pretty_wrapper(
_______, ______________________F_L__________________, KC_F11 , KC_F12 , ______________________F_R__________________, _______,
_______, _________________SYMBOL_L1_________________, _______, _______, _________________SYMBOL_R1_________________, _______,
_______, _________________SYMBOL_L2_________________, _________________SYMBOL_R2_________________, _______,
_______, _________________SYMBOL_L3_________________, _______, _______, _________________SYMBOL_R3_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______,
_______, _______, _______, _______, _______, _______
),
// See `users/pvinis/pvinis.h`
[LR_SYSCTL] = LAYOUT_ergodox_pretty_wrapper( [LR_SYSCTL] = LAYOUT_ergodox_pretty_wrapper(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, // clang-format off
_______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R1_________________, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _________________SYSCTL_R2_________________, _______, _______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R1_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R3_________________, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R2_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R3_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______
), // clang-format on
),
// See `users/pvinis/pvinis.h` // See `users/pvinis/pvinis.h`
[LR_KBCTL] = LAYOUT_ergodox_pretty_wrapper( [LR_KBCTL] = LAYOUT_ergodox_pretty_wrapper(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // clang-format off
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R1_________________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R2_________________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R1_________________, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R3_________________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R2_________________, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, __________________KBCTL_R3_________________, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
), // clang-format on
),
/* MOUSE /* MOUSE
* a keymap to control my system. * a keymap to control my system.
* *
* ,--------------------------------------------------. ,--------------------------------------------------. * ,--------------------------------------------------. ,--------------------------------------------------.
* | ^ | | | | | | | | | | | | | | | * | ^ | | | | | | | | | | | | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | | | | | | | | | MsUp | | | | * | | | | | | | | | | | | MsUp | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------| |MsLeft| MsDn |MsRght| | | * | | | | | | |------| |------| |MsLeft| MsDn |MsRght| | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | | * | | | | | | | | | | | |
* `----------------------------------' `----------------------------------' * `----------------------------------' `----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | | | | |MidClk| * | | | | |MidClk|
* ,------|------|------| |------+------+------. * ,------|------|------| |------+------+------.
* | | | | | |Left |Right | * | | | | | |Left |Right |
* | | |------| |------| Click| Click| * | | |------| |------| Click| Click|
* | | | ^ | | | | | * | | | ^ | | | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
[MOUSE] = LAYOUT_ergodox_pretty( [MOUSE] = LAYOUT_ergodox_pretty(
// clang-format off
KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO KC_TRNS ,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 ,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 ,KC_NO ,KC_NO
@ -212,53 +222,54 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
), // clang-format on
),
}; };
// keyboard initialization // keyboard initialization
void keyboard_post_init_user_local(void) { void keyboard_post_init_user_keymap(void) {
ergodox_led_all_on(); ergodox_led_all_on();
for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) {
ergodox_led_all_set(i); ergodox_led_all_set(i);
wait_ms(5); wait_ms(5);
} }
wait_ms(1000); wait_ms(1000);
for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { for (int i = LED_BRIGHTNESS_LO; i > 0; i--) {
ergodox_led_all_set(i); ergodox_led_all_set(i);
wait_ms(10); wait_ms(10);
} }
ergodox_led_all_off(); ergodox_led_all_off();
// restore default brightness for future use // restore default brightness for future use
ergodox_led_all_set(LED_BRIGHTNESS_HI); ergodox_led_all_set(LED_BRIGHTNESS_HI);
} }
// light up leds based on the layer // light up leds based on the layer
uint32_t layer_state_set_user_local(uint32_t state) { uint32_t layer_state_set_user_keymap(uint32_t state) {
ergodox_right_led_1_off(); ergodox_right_led_1_off();
ergodox_right_led_2_off(); ergodox_right_led_2_off();
ergodox_right_led_3_off(); ergodox_right_led_3_off();
switch (biton32(state)) { switch (biton32(state)) {
case LR_SYSCTL: case LR_SYSCTL:
ergodox_right_led_3_on(); // blue ergodox_right_led_3_on(); // blue
break; break;
case LR_KBCTL: case LR_KBCTL:
ergodox_right_led_1_on(); // red ergodox_right_led_1_on(); // red
break; break;
case LR_SYMBOL: case LR_SYMBOL:
ergodox_right_led_2_on(); // green ergodox_right_led_2_on(); // green
break; break;
default: break; default:
} break;
return state; }
return state;
} }
// extra keys // extra keys
// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
// switch (id) { // switch (id) {
// } // }
// return MACRO_NONE; // return MACRO_NONE;
// } // }
// tap dances // tap dances
@ -325,6 +336,6 @@ uint32_t layer_state_set_user_local(uint32_t state) {
// } // }
// qk_tap_dance_action_t tap_dance_actions[] = { // qk_tap_dance_action_t tap_dance_actions[] = {
// [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED( flash_each_tap, flash_dance_finished, flash_dance_reset ), // [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED( flash_each_tap, flash_dance_finished, flash_dance_reset ),
// [TD_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, layers_dance_finished, NULL ), // [TD_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, layers_dance_finished, NULL ),
// }; // };

View file

@ -1,24 +1,36 @@
#pragma once #pragma once
#ifdef PRODUCT #ifdef PRODUCT
#undef PRODUCT # undef PRODUCT
#define PRODUCT Iris Keyboard - pvinis # define PRODUCT Iris Keyboard - pvinis
#endif #endif
// Use I2C or Serial, not both.
// Use I2C or Serial, not both
#define USE_SERIAL #define USE_SERIAL
// #define USE_I2C // #define USE_I2C
// Select hand configuration.
// Select hand configuration // #define MASTER_LEFT
#define MASTER_LEFT #define MASTER_RIGHT
// #define MASTER_RIGHT
// #define EE_HANDS // #define EE_HANDS
// Choose pin to use for audio. C6 is the one iris uses.
// choose pin to use for audio. c6 is the one iris uses.
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#define C6_AUDIO # define C6_AUDIO
# define STARTUP_SONG SONG(NO_SOUND) // No startup song.
#endif
#ifdef RGBLIGHT_ENABLE
# undef RGBLED_NUM
# define RGBLED_NUM 16
#endif
#ifdef ENCODER_ENABLE
# define ENCODERS_PAD_A \
{ F5 } // I connected the encoder to F4 and F5.
# define ENCODERS_PAD_B \
{ F4 }
// #define ENCODERS_PAD_A_RIGHT { B5 }
// #define ENCODERS_PAD_B_RIGHT { C6 }
# define ENCODER_RESOLUTION 2
#endif #endif

View file

@ -1,16 +1,16 @@
// pvinis iris // pvinis iris
// ,-----------------------------. ,-----------------------------. // make keebio/iris/rev2:pvinis:avrdude
// | | | | | | | | | | | | | | // ,-----------------------------. ┌────┬────┬────┬────┬────┬────┐
// |----+----+----+----+----+----| |----+----+----+----+----+----| // | | | | | | | │ │ │ │ │ │ │
// | | | | | | | | | | | | | | // |----+----+----+----+----+----| ├────┼────┼────┼────┼────┼────┤
// |----+----+----+----x----x----| |----x----x----+----+----+----| // | | | | | | | │ │ │ │ │ │ │
// | | | | | | | | | | | | | | // |----+----+----+----x----x----| ├────╆━━━━╅────┼────┼────┼────┤
// |----+----+----+----x----x----+----. ,----|----x----x----+----+----+----| // | | | | | | | │ ┃ ┃ │ │ │ │
// | | | | | | | | | | | | | | | | // |----+----+----+----x----x----+----. ┌────┼────╄━━━━╃────┼────┼────┼────┤
// `-------------------+----+----+----/ \----+----+----+-------------------' // | | | | | | | | │ │ │ │ │ │ │ │
// | | | | | | | | // `-------------------+----+----+----/ └┬───┴┬───┴┬───┴┬───┴────┴────┴────┘
// `----+---------' `--------------' // | | | | │ │ │ │
// `----+---------' └────┴────┴────┘
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "pvinis.h" #include "pvinis.h"
@ -19,102 +19,179 @@
//#include "eeconfig.h" //#include "eeconfig.h"
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#include "audio.h" # include "audio.h"
#endif #endif
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
// #define STARTUP_SONG SONG(SONIC_RING) // #define STARTUP_SONG SONG(SONIC_RING)
#endif #endif
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
float tone_sonic[][2] = SONG(IN_LIKE_FLINT); // float n04[][2] = SONG(CLOSE_ENCOUNTERS_5_NOTE);
float tone_1[][2] = SONG(QWERTY_SOUND); // float n10[][2] = SONG(STARTUP_SOUND);
float tone_2[][2] = SONG(OLD_SPICE); // float n11[][2] = SONG(GOODBYE_SOUND);
float tone_3[][2] = SONG(OVERWATCH_THEME); // float n12[][2] = SONG(PLANCK_SOUND);
float tone_4[][2] = SONG(QWERTY_SOUND); // float n19[][2] = SONG(MUSIC_ON_SOUND);
// float n20[][2] = SONG(AUDIO_ON_SOUND);
// float n29[][2] = SONG(CAPS_LOCK_ON_SOUND);
// float n30[][2] = SONG(CAPS_LOCK_OFF_SOUND);
// float n31[][2] = SONG(SCROLL_LOCK_ON_SOUND);
// float n32[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
// float n33[][2] = SONG(NUM_LOCK_ON_SOUND);
// float n34[][2] = SONG(NUM_LOCK_OFF_SOUND);
// float n40[][2] = SONG(ONE_UP_SOUND);
// float n49[][2] = SONG(E1M1_DOOM);
// float n53[][2] = SONG(OLD_SPICE);
// float n56[][2] = SONG(RICK_ROLL);
// float n57[][2] = SONG(FF_PRELUDE);
// RGB_MODE_KNIGHT
// float n78[][2] = SONG(KATAMARI_ROLLING_STAR);
#endif #endif
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ,-----------------------------. ,-----------------------------. // ,-----------------------------. ,-----------------------------.
// | | | | | |QWER| | | | | | | | // | | | | |GAME|QWER| | | | | | | |
// |----+----+----+----+----+----| |----+----+----+----+----+----| // |----+----+----+----+----+----| |----+----+----+----+----+----|
// |Tab | | | | |CARP| | | | | | |Del | // |Tab | | | | |CRPL| | | | | | |Del |
// |----+----+----+----x----x----| |----x----x----+----+----+----| // |----+----+----+----x----x----| |----x----x----+----+----+----|
// |EscC| | | | | | | | | | | |Ent | // |EscC| | | | | | | | | | | |Ent |
// |----+----+----+----x----x----+----. ,----|----x----x----+----+----+----| // |----+----+----+----x----x----+----. ,----|----x----x----+----+----+----|
// |LSft| | | | | |Home| |End | | | | | |Rsft| // |LSft| | | | | |Home| |End | | | | | |Rsft|
// `-------------------+----+----+----/ \----+----+----+-------------------' // `-------------------+----+----+----/ \----+----+----+-------------------'
// |Cmd |LOWR|Bspc| |Spc |RASE|RAlt| // |Cmd |LOWR|Bspc| |Spc |RASE|RAlt|
// `----+---------' `--------------' // `----+---------' `--------------'
[LR_BASE] = LAYOUT_wrapper( [LR_BASE] = LAYOUT_wrapper(
_______, _______, _______, _______, _______, QWERTY , _______, _______, _______, _______, _______, _______, // clang-format off
KC_TAB , _______, _______, _______, _______, CARPALX, _______, _______, _______, _______, _______, KC_DEL , KC_MUTE, _______, _______, _______, GAME1 , QWERTY , KC_1 , _______, _______, _______, _______, _______,
PV_ESCC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT , KC_TAB , ___________________________________________, ___________________________________________, KC_DEL ,
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, PV_ESCC, ___________________________________________, ___________________________________________, KC_ENT ,
KC_LGUI, SYMBOL , KC_BSPC, KC_SPC , SYSCTL , KC_RALT KC_LSFT, ___________________________________________, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,
), KC_LGUI, SYMBOL , KC_BSPC, KC_SPC , SYSCTL , KC_RALT
// clang-format on
),
// ,-----------------------------. ,-----------------------------. // ,-----------------------------. ,-----------------------------.
// | | NUMBERS_L | | NUMBERS_R | | // | | NUMBERS_L | | NUMBERS_R | |
// |----+----+----+----+----+----| |----+----+----+----+----+----| // |----+----+----+----+----+----| |----+----+----+----+----+----|
// | | | | | | // | | | | | |
// |----+ | | +----| // |----+ | | +----|
// | | QWERTY_L | | QWERTY_R | | // | | QWERTY_L | | QWERTY_R | |
// |----+ +----. ,----| +----| // |----+ +----. ,----| +----|
// | | | | | | | | // | | | | | | | |
// `-------------------+----+----+----/ \----+----+----+-------------------' // `-------------------+----+----+----/ \----+----+----+-------------------'
// | | | | | | | | // | | | | | | | |
// `----+---------' `--------------' // `----+---------' `--------------'
[LR_QWERTY] = LAYOUT_wrapper( [LR_QWERTY] = LAYOUT_wrapper(
_______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, _______, // clang-format off
_______, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, _______, _______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, _______,
_______, _____________MOD_QWERTY_L2_________________, _____________MOD_QWERTY_R2_________________, _______, _______, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, _______,
_______, _________________QWERTY_L3_________________, _______, _______, _________________QWERTY_R3_________________, _______, _______, _____________MOD_QWERTY_L2_________________, _________________QWERTY_R2_________________, _______,
_______, _______, _______, _______, _______, _______ _______, _________________QWERTY_L3_________________, _______, _______, _________________QWERTY_R3_________________, _______,
), _______, _______, _______, _______, _______, _______
// clang-format on
),
// ,-----------------------------. ,-----------------------------. // ,-----------------------------. ,-----------------------------.
// | | NUMBERS_L | | NUMBERS_R | | // | | NUMBERS_L | | NUMBERS_R | |
// |----+----+----+----+----+----| |----+----+----+----+----+----| // |----+----+----+----+----+----| |----+----+----+----+----+----|
// | | | | | | // | | | | | |
// |----+ | | +----| // |----+ | | +----|
// | | CARPALX_L | | CARPALX_R | | // | | CARPALX_L | | CARPALX_R | |
// |----+ +----. ,----| +----| // |----+ +----. ,----| +----|
// | | | | | | | | // | | | | | | | |
// `-------------------+----+----+----/ \----+----+----+-------------------' // `-------------------+----+----+----/ \----+----+----+-------------------'
// | | | | | | | | // | | | | | | | |
// `----+---------' `--------------' // `----+---------' `--------------'
[LR_CARPALX] = LAYOUT_wrapper( [LR_CARPALX] = LAYOUT_wrapper(
_______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, _______, // clang-format off
_______, ________________CARPALX_L1_________________, ________________CARPALX_R1_________________, _______, _______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, _______,
_______, ________________CARPALX_L2_________________, ________________CARPALX_R2_________________, _______, _______, ________________CARPALX_L1_________________, ________________CARPALX_R1_________________, _______,
_______, ________________CARPALX_L3_________________, _______, _______, ________________CARPALX_R3_________________, _______, _______, ________________CARPALX_L2_________________, ________________CARPALX_R2_________________, _______,
_______, _______, _______, _______, _______, _______ _______, ________________CARPALX_L3_________________, _______, _______, ________________CARPALX_R3_________________, _______,
), _______, _______, _______, _______, _______, _______
// clang-format on
),
[LR_SYMBOL] = LAYOUT_wrapper( [LR_SYMBOL] = LAYOUT_wrapper(
KC_F12 , ______________________F_L__________________, ______________________F_R__________________, KC_F11 , // clang-format off
_______, _________________SYMBOL_L1_________________, _________________SYMBOL_R1_________________, _______, KC_F12 , ______________________F_L__________________, ______________________F_R__________________, KC_F11 ,
_______, _________________SYMBOL_L2_________________, _________________SYMBOL_R2_________________, _______, _______, _________________SYMBOL_L1_________________, _________________SYMBOL_R1_________________, _______,
_______, _________________SYMBOL_L3_________________, _______, _______, _________________SYMBOL_R3_________________, _______, _______, _________________SYMBOL_L2_________________, _________________SYMBOL_R2_________________, _______,
_______, _______, _______, _______, _______, _______ _______, _________________SYMBOL_L3_________________, _______, _______, _________________SYMBOL_R3_________________, _______,
), _______, _______, _______, _______, _______, _______
// clang-format on
),
[LR_SYSCTL] = LAYOUT_wrapper( [LR_SYSCTL] = LAYOUT_wrapper(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, // clang-format off
_______, _______, _______, _______, _______, _______, _________________SYSCTL_R1_________________, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _________________SYSCTL_R2_________________, _______, _______, _________________SYSCTL_L1_________________, _________________SYSCTL_R1_________________, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _________________SYSCTL_R3_________________, _______, _______, _________________SYSCTL_L2_________________, _________________SYSCTL_R2_________________, _______,
_______, _______, _______, _______, _______, _______ _______, _________________SYSCTL_L3_________________, _______, _______, _________________SYSCTL_R3_________________, _______,
), _______, _______, _______, _______, _______, _______
// clang-format on
),
[LR_KBCTL] = LAYOUT_wrapper( [LR_KBCTL] = LAYOUT_wrapper(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, // clang-format off
XXXXXXX, __________________KBCTL_L1_________________, __________________KBCTL_R1_________________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, __________________KBCTL_L2_________________, __________________KBCTL_R2_________________, XXXXXXX, XXXXXXX, __________________KBCTL_L1_________________, __________________KBCTL_R1_________________, XXXXXXX,
BASE , __________________KBCTL_L3_________________, XXXXXXX, XXXXXXX, __________________KBCTL_R3_________________, XXXXXXX, XXXXXXX, __________________KBCTL_L2_________________, __________________KBCTL_R2_________________, XXXXXXX,
XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX BASE , __________________KBCTL_L3_________________, XXXXXXX, XXXXXXX, __________________KBCTL_R3_________________, XXXXXXX,
) XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX
// clang-format on
),
// ,-----------------------------. ,-----------------------------.
// | | NUMBERS_L | | NUMBERS_R | |
// |----+----+----+----+----+----| |----+----+----+----+----+----|
// | | | | | |
// |----+ | | +----|
// |ESC | QWERTY_L | | QWERTY_R | |
// |----+ +----. ,----| +----|
// | | | | | | | |
// `-------------------+----+----+----/ \----+----+----+-------------------'
// | |SPC | | | | | |
// `----+---------' `--------------'
[LR_GAME1] = LAYOUT_wrapper(
// clang-format off
_______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, KC_BSPC,
_______, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, QWERTY ,
KC_ESC , _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, _______,
_______, _________________QWERTY_L3_________________, _______, _______, _________________QWERTY_R3_________________, _______,
_______, _______, KC_SPC , _______, _______, _______
// clang-format on
),
[LR_GAME2] = LAYOUT_wrapper(
// clang-format off
_______, ________________NUMBERS_L__________________, ________________NUMBERS_R__________________, KC_BSPC,
_______, _________________QWERTY_L1_________________, KC_Y , KC_U , KC_UP , KC_O , KC_P , QWERTY ,
KC_ESC , _________________QWERTY_L2_________________, KC_H , KC_LEFT, KC_DOWN, KC_RGHT, KC_SCLN, _______,
_______, _________________QWERTY_L3_________________, _______, _______, _________________QWERTY_R3_________________, _______,
_______, _______, KC_SPC , _______, _______, _______
// clang-format on
),
}; };
#ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) {
// if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
// }
}
#endif
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef AUDIO_ENABLE
// case PV_S04: if (record->event.pressed) PLAY_SONG(n04); return false; break;
#endif
}
return true; // Process everything else normally
}

View file

@ -1,2 +1,9 @@
AUDIO_ENABLE = no # off for now TAP_DANCE_ENABLE = yes
RGBLIGHT_ENABLE = no # off for now AUDIO_ENABLE = no # piezo speaker sounds
RGBLIGHT_ENABLE = yes # rgb leds underlight
ENCODER_ENABLE = yes # rotary knob
# Some extra stuff to make firmware smaller.
LINK_TIME_OPTIMIZATION_ENABLE = yes
CONSOLE_ENABLE = no
COMMAND_ENABLE = no

View file

@ -1,10 +1,9 @@
#pragma once #pragma once
#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 // allow rolling when keys have hold functionality
#define IGNORE_MOD_TAP_INTERRUPT #define IGNORE_MOD_TAP_INTERRUPT
// #define TAPPING_TERM 150 // #define TAPPING_TERM 150
#if defined(MOUSE_KEYS)
# define MOUSEKEY_WHEEL_TIME_TO_MAX 1
#endif

View file

@ -2,88 +2,97 @@
#include "version.h" #include "version.h"
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#include "audio.h" # include "audio.h"
#endif // AUDIO_ENABLE
#ifdef AUDIO_ENABLE
// float tone_katamari_rolling_star[][2] = SONG(KATAMARI_ROLLING_STAR);
#endif // AUDIO_ENABLE
float song_sonic_ring[][2] = SONG(SONIC_RING);
float song_coin_sound[][2] = SONG(COIN_SOUND);
float song_test[][2] = SONG(QWERTY_SOUND);
#endif
// SYMBOL + SYSCTL = KBCTL // SYMBOL + SYSCTL = KBCTL
uint32_t layer_state_set_user(uint32_t state) { uint32_t layer_state_set_user(uint32_t state) {
uint32_t intermediate_state = update_tri_layer_state(state, LR_SYMBOL, LR_SYSCTL, LR_KBCTL); uint32_t intermediate_state = update_tri_layer_state(state, LR_SYMBOL, LR_SYSCTL, LR_KBCTL);
intermediate_state = layer_state_set_user_local(intermediate_state); intermediate_state = layer_state_set_user_keymap(intermediate_state);
return intermediate_state; return intermediate_state;
} }
// functions for the individual keymaps to implement if they need something extra // functions for the individual keymaps to implement if they need something extra
__attribute__ ((weak)) __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;
}
// Handle my own keycodes.
// handle my own keycodes
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case PV_VRSN:
if (record->event.pressed) {
SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
return false;
case PV_VRSN: case PV_MAKE:
if (record->event.pressed) { // make ergodox_ez:pvinis:teensy
SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); if (!record->event.pressed) {
} SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
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)) #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
":dfu" ":dfu"
#elif defined(BOOTLOADER_HALFKAY) #elif defined(BOOTLOADER_HALFKAY)
":teensy" ":teensy"
#elif defined(BOOTLOADER_CATERINA) #elif defined(BOOTLOADER_CATERINA)
":avrdude" ":avrdude"
#endif #endif
SS_TAP(X_ENTER) SS_TAP(X_ENTER));
); }
} return false;
return false;
case PV_FLSH: case PV_FLSH:
reset_keyboard(); reset_keyboard();
return false; return false;
case PV_KTMR: case PV_SSNC:
if (record->event.pressed) { if (record->event.pressed) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
// PLAY_SONG(tone_katamari_rolling_star); PLAY_SONG(song_sonic_ring);
#endif #endif
} }
return false; return false;
}
return process_record_keymap(keycode, record);
}
case PV_SCIN:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(song_coin_sound);
#endif
}
return false;
case PV_TEST:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(song_test);
#endif
}
return false;
}
return process_record_keymap(keycode, record);
}
#ifdef TAP_DANCE_ENABLE #ifdef TAP_DANCE_ENABLE
qk_tap_dance_action_t tap_dance_actions[] = { qk_tap_dance_action_t tap_dance_actions[] = {};
}; #endif
#endif // TAP_DANCE_ENABLE
void keyboard_post_init_rgb_light(void) {
rgblight_sethsv(HSV_GOLD);
rgblight_mode(RGBLIGHT_MODE_BREATHING);
// rgblight_mode(RGBLIGHT_MODE_KNIGHT+1);
}
// init stuff // Init stuff.
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
keyboard_post_init_user_local(); #if defined(RGBLIGHT_ENABLE)
keyboard_post_init_rgb_light();
#endif
keyboard_post_init_user_keymap();
} }
// Default functions.
__attribute__((weak)) void keyboard_post_init_user_keymap(void) {}
// default functions __attribute__((weak)) uint32_t layer_state_set_user_keymap(uint32_t state) { return state; }
__attribute__ ((weak))
void keyboard_post_init_user_local(void) {}
__attribute__ ((weak))
uint32_t layer_state_set_user_local(uint32_t state) {
return state;
}

View file

@ -2,84 +2,103 @@
#include "quantum.h" #include "quantum.h"
// My own keycodes.
// my own keycodes
enum userspace_custom_keycodes { enum userspace_custom_keycodes {
PV_ = SAFE_RANGE, PV_ = SAFE_RANGE,
PV_VRSN, // prints firmware version PV_VRSN, // Print firmware version.
PV_MAKE, // prints the make command of the keyboard PV_MAKE, // Print the make command of the keyboard.
PV_FLSH, // resets keyboard PV_FLSH, // Reset keyboard.
PV_KTMR, // play katamari music
PV_SAFE_RANGE, // used for extra keycodes in the individual keymaps PV_SSNC, // Play Sonic Ring.
PV_SCIN, // Play Coin Sound.
PV_TEST, // For quick testing purposes.
PV_SAFE_RANGE, // Used for extra keycodes in individual keymaps.
}; };
enum tap_dance_indexes { enum tap_dance_indexes {
// tap dance // tap dance
TD_FLSH, // flash keyboard (as if the physical flash key was pressed) 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 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_ESCC CTL_T(KC_ESC) // esc on tap, ctrl on hold.
#define PV_LOCK LCTL(LSFT(KC_PWR)) // lock computer #define PV_LOCK LCTL(LSFT(KC_PWR)) // Lock computer.
#define TD_3FLS TD(TD_FLSH) // tap dance 3 times for flash #define TD_3FLS TD(TD_FLSH) // Tap dance 3 times for flash.
// Layers.
// layers
enum { enum {
LR_BASE = 0, // used for basic keys like the surrounding ctrl, cmd, etc LR_BASE = 0, // used for basic keys like the surrounding ctrl, cmd, etc
LR_QWERTY, LR_QWERTY,
LR_CARPALX, LR_CARPALX,
LR_GAME1, // game layout (space on the left thumb, no modifiers, etc)
LR_GAME2, // game layout (space on the left thumb, no modifiers, etc, arrows)
LR_SYMBOL, // symbol input (!, @, #, etc)
LR_SYSCTL, // system control (music, volume, keyboard flash, etc)
LR_KBCTL, // keyboard control (version, make, flash, etc)
LR_SYMBOL, // symbol input (!, @, #, etc)
LR_SYSCTL, // system control (music, volume, keyboard flash, etc)
LR_KBCTL, // keyboard control (version, make, flash, etc)
}; };
// Layer switchers.
// layer switchers #define BASE TO(LR_BASE)
#define BASE TO(LR_BASE) #define QWERTY TO(LR_QWERTY)
#define QWERTY TO(LR_QWERTY)
#define CARPALX TO(LR_CARPALX) #define CARPALX TO(LR_CARPALX)
#define GAME1 TO(LR_GAME1)
#define GAME2 TO(LR_GAME2)
#define SYMBOL MO(LR_SYMBOL) #define SYMBOL MO(LR_SYMBOL)
#define SYSCTL MO(LR_SYSCTL) #define SYSCTL MO(LR_SYSCTL)
#define KBCTL MO(LR_KBCTL) #define KBCTL MO(LR_KBCTL)
// Layout parts for easy reuse between keyboard keymaps.
// layout parts for easy reuse between keyboard keymaps // Transparent.
// ┌─────┬─────┬─────┬─────┬─────┐
// │ │ │ │ │ │
// └─────┴─────┴─────┴─────┴─────┘
#define ___________________________________________ _______, _______, _______, _______, _______
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // Numbers.
// | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | // ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // │ 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 #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
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // F keys.
// | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | // ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // │ 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 #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
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // QWERTY.
// | Q | W | E | R | T | | Y | U | I | O | P | // ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // │ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │
// | A | S | D | F | G | | H | J | K | L | ; | // ├─────┼─────┼─────╆━━━━━╅─────┤ ├─────╆━━━━━╅─────┼─────┼─────┤
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // │ A │ S │ D ┃ F ┃ G │ │ H ┃ J ┃ K │ L │ ; │
// | Z | X | C | V | B | | N | M | , | . | / | // ├─────┼─────┼─────╄━━━━━╃─────┤ ├─────╄━━━━━╃─────┼─────┼─────┤
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // │ 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_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
#define _________________QWERTY_L3_________________ KC_Z , KC_X , KC_C , KC_V , KC_B #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_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_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 _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
#define _____________MOD_QWERTY_L2_________________ CTL_T(KC_A), SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G // QWERTY with mods.
#define _____________MOD_QWERTY_R2_________________ KC_H , ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), CTL_T(KC_SCLN) // ┌───────┬───────┬───────┲━━━━━━━┱───────┐ ┌───────┲━━━━━━━┱───────┬───────┬───────┐
// │ ctl/A │ sft/S │ cmd/D ┃ opt/F ┃ G │ │ H ┃ opt/J ┃ cmd/K │ sft/L │ ctl/; │
// └───────┴───────┴───────┺━━━━━━━┹───────┘ └───────┺━━━━━━━┹───────┴───────┴───────┘
// #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_L2_________________ KC_A, KC_S, 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 | // | Q | G | M | L | W | | Y | F | I | O | P |
@ -88,13 +107,13 @@ enum {
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----,
// | Z | X | C | V | J | | K | P | , | . | / | // | Z | X | C | V | J | | K | P | , | . | / |
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----,
#define ________________CARPALX_L1_________________ KC_Q , KC_G , KC_M , KC_L , KC_W #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_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_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_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_R2_________________ KC_I, KC_A, KC_E, KC_O, KC_H
#define ________________CARPALX_R3_________________ KC_K , KC_P , KC_COMM, KC_DOT , KC_SLSH #define ________________CARPALX_R3_________________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----,
// | ! | @ | { | } | _ | | \ | | ` | | | // | ! | @ | { | } | _ | | \ | | ` | | |
@ -103,50 +122,51 @@ enum {
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----,
// | % | ^ | [ | ] | + | | * | ~ | < | > | / | // | % | ^ | [ | ] | + | | * | ~ | < | > | / |
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----,
#define _________________SYMBOL_L1_________________ KC_EXLM, KC_AT , KC_LCBR, KC_RCBR, KC_UNDS #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_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_L3_________________ KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_PLUS
#define _________________SYMBOL_R1_________________ KC_BSLS, _______, KC_GRV , _______, _______ #define _________________SYMBOL_R1_________________ KC_BSLS, _______, KC_GRV, _______, _______
#define _________________SYMBOL_R2_________________ KC_EQL , KC_AMPR, KC_QUOT, KC_DQUO, KC_PIPE #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 #define _________________SYMBOL_R3_________________ KC_ASTR, KC_TILD, KC_LABK, KC_RABK, KC_SLSH
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // System Control.
// | | | | | | |MUTE |HOME | ^ | END | | // vol ↓ ctl ↓
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐
// | | | | | | |VOLUP| < | v | > | | // │ │ │ │ │ │ │MUTE │HOME │ ↑ │ END │LOCK │
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // ├─────┼─────┼─────╆━━━━━╅─────┤ ├─────╆━━━━━╅─────┼─────┼─────┤
// | | | | | | |VOLDN|MPREV|MPLAY|MNEXT| | // │ │ │ ┃ ┃ │ │VOLUP┃ ← ┃ ↓ │ → │SLEEP│ ← arrows
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // ├─────┼─────┼─────╄━━━━━╃─────┤ ├─────╄━━━━━╃─────┼─────┼─────┤
#define _________________SYSCTL_L1_________________ // │ │ │ │ │ │ │VOLDN│MPREV│MPLAY│MNEXT│ PWR │ ← music
#define _________________SYSCTL_L2_________________ // └─────┴─────┴─────┴─────┴─────┘ └─────┴─────┴─────┴─────┴─────┘
#define _________________SYSCTL_L3_________________ #define _________________SYSCTL_L1_________________ XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_BTN1, XXXXXXX
#define _________________SYSCTL_L2_________________ XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_RIGHT, KC_MS_WH_UP
#define _________________SYSCTL_L3_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_WH_DOWN
// vol v ctl v // vol v ctl v
#define _________________SYSCTL_R1_________________ KC_MUTE , KC_HOME , KC_UP , KC_END , PV_LOCK #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_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 #define _________________SYSCTL_R3_________________ KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT /* < music */, KC_PWR
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----,
// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| // |GAME |CRPLX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----,
// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|VERSN|MAKE |FLASH|XXXXX| // |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|VERSN|MAKE |FLASH|XXXXX|
// ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----, // ,-----+-----+-----x-----x-----, ,-----x-----x-----+-----+-----,
// |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| // |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX| |XXXXX|XXXXX|XXXXX|XXXXX|XXXXX|
// ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----, // ,-----+-----+-----+-----+-----, ,-----+-----+-----+-----+-----,
#define __________________KBCTL_L1_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX #define __________________KBCTL_L1_________________ PV_SSNC, PV_SCIN, PV_TEST, XXXXXXX, XXXXXXX
#define __________________KBCTL_L2_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX #define __________________KBCTL_L2_________________ RGB_TOG, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX
#define __________________KBCTL_L3_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX #define __________________KBCTL_L3_________________ RGB_MOD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX
#define __________________KBCTL_R1_________________ XXXXXXX, XXXXXXX, XXXXXXX, PV_KTMR, XXXXXXX #define __________________KBCTL_R1_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
#define __________________KBCTL_R2_________________ XXXXXXX, PV_VRSN, PV_MAKE, PV_FLSH, XXXXXXX #define __________________KBCTL_R2_________________ XXXXXXX, PV_VRSN, PV_MAKE, PV_FLSH, XXXXXXX
#define __________________KBCTL_R3_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 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 // 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_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
// Extra stuff that might be needed.
// extra stuff that might be needed void keyboard_post_init_user_keymap(void);
void keyboard_post_init_user_local(void); uint32_t layer_state_set_user_keymap(uint32_t state);
uint32_t layer_state_set_user_local(uint32_t state);

View file

@ -1,15 +1,19 @@
# add userspace file SRC += pvinis.c # 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 ## Use the stuff below on the keyboard keymaps, not here.
LINK_TIME_OPTIMIZATION_ENABLE = yes ## If they are used here, they will replace the keymap's rules, since this file is eval'd later.
CONSOLE_ENABLE = no
COMMAND_ENABLE = no # TAP_DANCE_ENABLE = yes
# AUDIO_ENABLE = yes # piezo speaker sounds
# RGBLIGHT_ENABLE = yes # rgb leds underlight
# BACKLIGHT_ENABLE = no # leds under keycaps
# MOUSEKEY_ENABLE = yes
# LEEP_LED_ENABLE = no # no led blinking while sleeping
# KRO_ENABLE = yes
## Some extra stuff to make firmware smaller.
# LINK_TIME_OPTIMIZATION_ENABLE = yes
# CONSOLE_ENABLE = no
# COMMAND_ENABLE = no