Updating the layout

pull/3272/head
zjpxshade 6 years ago
parent e348afa41a
commit 181822d195

@ -22,8 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Use I2C or Serial, not both */
#define USE_SERIAL
// #define USE_I2C
//#define USE_SERIAL
#define USE_I2C
/* Select hand configuration */

@ -4,18 +4,26 @@
extern keymap_config_t keymap_config;
#define _QWERTY 0
#define _LOWER 1
#define _RAISE 2
#define _DVORAK 0
#define _QWERTY 1
#define _GAMING 13
#define _LOWER 14
#define _RAISE 15
#define _ADJUST 16
enum custom_keycodes {
QWERTY = SAFE_RANGE,
DVORAK = SAFE_RANGE,
GAME,
DVPR,
QRTY,
QUIT,
LOWER,
RAISE,
ADJUST,
};
//Definitions of Different Keys Go Here
#define KC_ KC_TRNS
#define _______ KC_TRNS
@ -32,60 +40,112 @@ enum custom_keycodes {
#define KC_RSAD RGB_SAD
#define KC_RVAI RGB_VAI
#define KC_RVAD RGB_VAD
#define KC_DVPR DF(_DVORAK)
#define KC_GAME DF(_GAMING)
#define KC_QRTY DF(_QWERTY)
#define KC_QUIT LSFT(LALT(KC_Q))
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// All custom layers should be placed below LOWER, RAISE, and ADJUST -- in that order.
// LOWER and RAISE have helpful keys on them. ADJUST is to adjust the keyboard's settings.
// I suppose that a pedestrian way of setting it up would be to make it as close to the old
// KB as possible and then slowly adjust things from there.
//DVORAK (Base Layer)
[_DVORAK] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
ESC , 7 , 5 , 3 , 1 , 9 , 2 , 4 , 6 , 8 , 0 ,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB ,SCLN,COMM,DOT , P , Y , F , G , C , R , L ,DEL ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT, A , O , E , U , I , D , H , T , N , S ,RSFT,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
LCTL,QUOT, Q , J , K , X ,HOME, END , B , M , W , V , Z ,SLSH,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LALT,LOWR,ENT , SPC ,RASE,LGUI
// `----+----+----' `----+----+----'
),
//QWERTY
[_QWERTY] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB , ,COMM,DOT , P , Y , F , G , C , R , L ,DEL ,
TAB , Q , W , E , R , T , Y , U , I , O , P ,QUOT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT, A , O , E , U , I , D , H , T , N , S ,INS ,
LSFT, A , S , D , F , G , H , J , K , L ,SCLN,ENT ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
LCTL,QUOT, Q , J , K , X ,HOME, END , B , M , W , V , Z ,RSFT,
LCTL, Z , X , C , V , B ,HOME, END , N , M ,COMM,DOT ,SLSH,RSFT,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LGUI,LOWR,ENT , SPC ,RASE,LALT
LALT,LOWR,SPC , SPC ,RASE,LGUI
// `----+----+----' `----+----+----'
),
[_LOWER] = LAYOUT_kc(
//GAMING
[_GAMING] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC,
ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , ,
QUOT,TAB , Q , W , E , R , T , Y , U , I , O , P ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE,
INS ,LSFT, A , S , D , F , G , H , J , K , L ,SCLN,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
BL_S, , , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, ,
DEL ,LCTL, Z , X , C , V ,SPC, ENT , B , N , M ,COMM,DOT ,SLSH,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, ,DEL , DEL , , P0
LALT,LOWR,LCTL, SPC ,RASE,LGUI
// `----+----+----' `----+----+----'
),
//GAMELOWER -- For one handed gaming
//LOWER - MAYBE TRY AND MAKE IT RIGHT HANDED SINCE LOWER IS ON LT?
[_LOWER] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , , , , , , , , ,
//|----+----+---+----+----+----| |----+----+----+----+----+----|
, , , , , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , ,LEFT, UP ,DOWN,RGHT, ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
),
//RAISE - MAYBE TRY AND MAKE IT LEFT HANDED SINCE RAISE IS ON RT?
[_RAISE] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
QUIT, , , , , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, ,
, , , , , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS,
, , , , , , , , , , , ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , ,
, , , , , , , , , , , , , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
),
//ADJUST
/*TOP ROW: Different custom defined layers, in order
* 2ND ROW:
* 3RD ROW:
* 4TH ROW:
* LTHUMBS:
* RTHUMBS:
*/
[_ADJUST] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , , , , , , , , ,
DVPR,QRTY, ,GAME, , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , ,
BL_S, , , , , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,DBUG,RHUD,RSAD,RVAD, , , , , , , ,
, , , , , , , , , , , ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
BL_S,RST , , , , , , , , , , , , ,
, , , , , , , , , , , , ,RST ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
@ -93,6 +153,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
@ -100,37 +161,59 @@ void persistent_default_layer_set(uint16_t default_layer) {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
//After this point, it's all about switching layers
case DVORAK: //DVORAK here is the base layer
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case QRTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case GAME: //GAME is now a keycode here
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_GAMING); //revert to Qwerty if we're on NSA/Windows
} //to play V / I / D / E / O ~ G / A / M / E / S
return false;
break;
case DVPR:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DVORAK); //Changes base layer to _DVORAK
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
}
else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
case RAISE: //Defines what happens when the RAISE key is pressed
if (record->event.pressed) { //if they key is pressed
layer_on(_RAISE); //toggle on the RAISE layer
update_tri_layer(_LOWER, _RAISE, _ADJUST); //update our layers to check if the LOWER key is pressed
}
else { //if the key is not pressed
layer_off(_RAISE); //leave everything alone
update_tri_layer(_LOWER, _RAISE, _ADJUST); //update the layers???
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
if (record->event.pressed) { //RAISE + LOWER = ADJUST
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
else {
layer_off(_ADJUST); //Releasing one of them goes to the other one
}
return false;
break;

Loading…
Cancel
Save