2019-07-07 09:53:56 +06:00
|
|
|
#include QMK_KEYBOARD_H
|
|
|
|
|
|
|
|
extern keymap_config_t keymap_config;
|
|
|
|
|
|
|
|
enum layer_names {
|
|
|
|
_QWERTY,
|
2019-07-22 15:13:38 +06:00
|
|
|
_COLEMAK,
|
2019-07-07 09:53:56 +06:00
|
|
|
_LOWER,
|
|
|
|
_RAISE,
|
|
|
|
_ADJUST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum custom_keycodes {
|
2019-07-13 12:37:48 +06:00
|
|
|
QWERTY = SAFE_RANGE,
|
2019-07-22 15:13:38 +06:00
|
|
|
COLEMAK,
|
2019-07-13 12:37:48 +06:00
|
|
|
LOWER,
|
|
|
|
RAISE
|
2019-07-07 09:53:56 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
#define KC_ KC_TRNS
|
|
|
|
|
|
|
|
#define KC_LOWR LOWER
|
|
|
|
#define KC_RASE RAISE
|
|
|
|
#define KC_RST RESET
|
|
|
|
#define KC_BL_S BL_STEP
|
|
|
|
|
2019-07-22 15:13:38 +06:00
|
|
|
// left shift as a left key too - makes perfect sense
|
|
|
|
#define KC_LESF LSFT_T(KC_LEFT)
|
2019-07-07 09:53:56 +06:00
|
|
|
|
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
|
|
|
[_QWERTY] = LAYOUT_kc(
|
|
|
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
|
|
|
GESC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
|
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
|
|
|
TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS,
|
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
2019-07-22 15:13:38 +06:00
|
|
|
LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
|
2019-07-07 09:53:56 +06:00
|
|
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
2019-07-22 15:13:38 +06:00
|
|
|
LESF, Z , X , C , V , B ,LBRC, RBRC, N , M ,COMM,DOT ,SLSH,RGHT,
|
2019-07-13 12:37:48 +06:00
|
|
|
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
|
|
|
LGUI,LOWR,ENT , SPC ,RASE,RALT
|
|
|
|
// `----+----+----' `----+----+----'
|
|
|
|
),
|
|
|
|
|
2019-07-22 15:13:38 +06:00
|
|
|
[_COLEMAK] = LAYOUT_kc(
|
2019-07-13 12:37:48 +06:00
|
|
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
|
|
|
GESC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
|
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
2019-07-22 15:13:38 +06:00
|
|
|
TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,BSLS,
|
2019-07-13 12:37:48 +06:00
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
2019-07-22 15:13:38 +06:00
|
|
|
LCTL, A , R , S , T , D , H , N , E , I , O ,QUOT,
|
2019-07-13 12:37:48 +06:00
|
|
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
2019-07-22 15:13:38 +06:00
|
|
|
LESF, Z , X , C , V , B ,LBRC, RBRC, K , M ,COMM,DOT ,SLSH,RGHT,
|
2019-07-07 09:53:56 +06:00
|
|
|
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
|
|
|
LGUI,LOWR,ENT , SPC ,RASE,RALT
|
|
|
|
// `----+----+----' `----+----+----'
|
|
|
|
),
|
|
|
|
|
|
|
|
[_LOWER] = LAYOUT_kc(
|
|
|
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
2019-07-22 15:13:38 +06:00
|
|
|
GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL ,
|
2019-07-07 09:53:56 +06:00
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
2019-07-13 12:37:48 +06:00
|
|
|
, , , , , , , ,BTN1, , , ,
|
2019-07-07 09:53:56 +06:00
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
2019-07-13 12:37:48 +06:00
|
|
|
, , , , , , MS_L,MS_D,MS_U,MS_R, , ,
|
2019-07-07 09:53:56 +06:00
|
|
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
2019-07-22 15:13:38 +06:00
|
|
|
, , , , , UP , , ,DOWN, , , , , ,
|
2019-07-07 09:53:56 +06:00
|
|
|
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
|
|
|
, , , , ,
|
|
|
|
// `----+----+----' `----+----+----'
|
|
|
|
|
|
|
|
),
|
|
|
|
[_RAISE] = LAYOUT_kc(
|
|
|
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
|
|
|
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
|
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
|
|
|
, ,VOLU, , ,LBRC, RBRC,UNDS,PLUS, , ,MUTE,
|
|
|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
|
|
|
,MPLY,VOLD,MNXT, ,LPRN, RPRN,MINS,EQL , , , ,
|
|
|
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
2019-07-22 15:13:38 +06:00
|
|
|
, , , , , , , , , , , , , ,
|
2019-07-07 09:53:56 +06:00
|
|
|
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
|
|
|
, , , , ,
|
|
|
|
// `----+----+----' `----+----+----'
|
|
|
|
),
|
|
|
|
|
|
|
|
[_ADJUST] = LAYOUT(
|
2019-07-29 10:16:59 +06:00
|
|
|
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
|
|
|
|
_______,_______,_______,_______,_______, QWERTY, COLEMAK,_______,_______,_______,_______,_______,
|
|
|
|
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
|
|
|
_______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI, _______,_______,_______,_______,_______,_______,
|
|
|
|
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
|
|
|
|
RESET ,DEBUG ,_______,RGB_HUD,RGB_SAD,RGB_VAD, _______,_______,_______,_______,_______,_______,
|
|
|
|
//|-------+-------+-------+-------+-------+-------+-------. ,-------|-------+-------+-------+-------+-------+-------|
|
|
|
|
BL_STEP,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,
|
|
|
|
//`--------+-------+-------+----+--+-------+-------+-------/ \-------+-------+-------+---+---+-------+-------+-------'
|
|
|
|
_______,_______,_______, _______,_______,_______
|
|
|
|
// `-------+-------+-------' `-------+-------+-------'
|
2019-07-07 09:53:56 +06:00
|
|
|
)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch (keycode) {
|
2019-07-13 12:37:48 +06:00
|
|
|
case QWERTY:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
set_single_persistent_default_layer(_QWERTY);
|
|
|
|
}
|
|
|
|
return false;
|
2019-07-22 15:13:38 +06:00
|
|
|
case COLEMAK:
|
2019-07-13 12:37:48 +06:00
|
|
|
if (record->event.pressed) {
|
2019-07-22 15:13:38 +06:00
|
|
|
set_single_persistent_default_layer(_COLEMAK);
|
2019-07-13 12:37:48 +06:00
|
|
|
}
|
|
|
|
return false;
|
2019-07-07 09:53:56 +06:00
|
|
|
case LOWER:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_on(_LOWER);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
} else {
|
|
|
|
layer_off(_LOWER);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
case RAISE:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_on(_RAISE);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
} else {
|
|
|
|
layer_off(_RAISE);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|