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