Updated my TV44 keymap to be more planck-like.

Used the current default planck keymap as a guide.
This commit is contained in:
Xyverz 2017-04-17 20:15:57 -07:00
parent a22286e834
commit a3aadd888f

View file

@ -4,20 +4,22 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
// Layer Names enum planck_layers {
#define _DVORAK 0 _QWERTY,
#define _QWERTY 1 _COLEMAK,
#define _COLEMAK 2 _DVORAK,
#define _LOWER 3 _LOWER,
#define _RAISE 4 _RAISE,
#define _ADJUST 16 _ADJUST
};
enum planck_keycodes { enum planck_keycodes {
DVORAK = SAFE_RANGE, DVORAK = SAFE_RANGE,
QWERTY, QWERTY,
COLEMAK, COLEMAK,
LOWER, LOWER,
RAISE RAISE,
ADJUST
}; };
// Layer-Tapping macros // Layer-Tapping macros
@ -74,52 +76,51 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
} }
}; };
const uint16_t PROGMEM fn_actions[] = {
};
void persistant_default_layer_set(uint16_t default_layer) { void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
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 DVORAK: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK); persistant_default_layer_set(1UL<<_QWERTY);
}
break;
case QWERTY:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY);
}
break;
case COLEMAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK);
}
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
} }
return MACRO_NONE; return false;
}; break;
case COLEMAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
}
return true;
}