Update keymap.c
This commit is contained in:
@@ -72,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, __________________NAV_L2____________________, __________________NAV_R2____________________, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, __________________NAV_L3____________________, WINDOWS, _______, __________________NAV_R3____________________, _______,
|
||||
_______, __________________NAV_L3____________________, LINUX, _______, __________________NAV_R3____________________, _______,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
___________THUMB_L3________, ___________THUMB_R3________
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
@@ -151,17 +151,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
uint8_t mod_state;
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static bool isWindows = false;
|
||||
static bool isLinux = false;
|
||||
mod_state = get_mods();
|
||||
switch (keycode) {
|
||||
case WINDOWS:
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
isWindows = !isWindows;
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
}
|
||||
return false;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(_COLEMAK_DH);
|
||||
}
|
||||
return false;
|
||||
case LINUX:
|
||||
if (record->event.pressed) {
|
||||
isLinux = !isLinux;
|
||||
}
|
||||
return false;
|
||||
case COPY:
|
||||
if (record->event.pressed) {
|
||||
if (isWindows) {
|
||||
if (isLinux) {
|
||||
tap_code16(LCTL(KC_C));
|
||||
} else {
|
||||
tap_code16(LGUI(KC_C));
|
||||
@@ -170,7 +180,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
case PASTE:
|
||||
if (record->event.pressed) {
|
||||
if (isWindows) {
|
||||
if (isLinux) {
|
||||
tap_code16(LCTL(KC_V));
|
||||
} else {
|
||||
tap_code16(LGUI(KC_V));
|
||||
@@ -179,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
case CUT:
|
||||
if (record->event.pressed) {
|
||||
if (isWindows) {
|
||||
if (isLinux) {
|
||||
tap_code16(LCTL(KC_X));
|
||||
} else {
|
||||
tap_code16(LGUI(KC_X));
|
||||
@@ -188,7 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
case UNDO:
|
||||
if (record->event.pressed) {
|
||||
if (isWindows) {
|
||||
if (isLinux) {
|
||||
tap_code16(LCTL(KC_Z));
|
||||
} else {
|
||||
tap_code16(LGUI(KC_Z));
|
||||
@@ -197,7 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
case REDO:
|
||||
if (record->event.pressed) {
|
||||
if (isWindows) {
|
||||
if (isLinux) {
|
||||
tap_code16(LCTL(KC_Y));
|
||||
} else {
|
||||
tap_code16(LSG(KC_Z));
|
||||
@@ -206,7 +216,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
case SALL:
|
||||
if (record->event.pressed) {
|
||||
if (isWindows) {
|
||||
if (isLinux) {
|
||||
tap_code16(LCTL(KC_A));
|
||||
} else {
|
||||
tap_code16(LGUI(KC_A));
|
||||
|
||||
Reference in New Issue
Block a user