Added info.json for mt980 keyboard and fixes to walker keymap (#5391)
* Added info.json and minor fixes to walker keymap * Fix url * Update keyboards/mt980/info.json Co-Authored-By: walkerstop <walkerstop@gmail.com> * Update keyboards/mt980/info.json Co-Authored-By: walkerstop <walkerstop@gmail.com> * Update keyboards/mt980/info.json Co-Authored-By: walkerstop <walkerstop@gmail.com> * Update keyboards/mt980/info.json Co-Authored-By: walkerstop <walkerstop@gmail.com> * Update keyboards/mt980/info.json Co-Authored-By: walkerstop <walkerstop@gmail.com> * Update keyboards/mt980/info.json Co-Authored-By: walkerstop <walkerstop@gmail.com> * Update keyboards/mt980/info.json Co-Authored-By: walkerstop <walkerstop@gmail.com> * Fix user calling keymap functions * cancel oneshot layer on KC_TRNS * Fix to oneshot layer handling * Fix oneshot handling of reset * Move bootmagic key to Esc where it normally resides * Remove deprecated function * Treat shift-numlock as shift-insert in Walker layer
This commit is contained in:
parent
f9c5b80aed
commit
c3b4f65c64
4 changed files with 171 additions and 12 deletions
|
@ -99,35 +99,68 @@ void led_set_keymap(uint8_t usb_led) {
|
|||
}
|
||||
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
switch (keycode) {
|
||||
case KC_TRNS:
|
||||
case KC_NO:
|
||||
/* Always cancel one-shot layer when another key gets pressed */
|
||||
if (record->event.pressed && is_oneshot_layer_active())
|
||||
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
|
||||
return true;
|
||||
case RESET:
|
||||
/* Don't allow reset from oneshot layer state */
|
||||
if (record->event.pressed && is_oneshot_layer_active()) {
|
||||
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case KC_PPLS:
|
||||
if (!numlock_on) {
|
||||
if (get_oneshot_layer() == 1 || layer_state & 0x2) {
|
||||
register_code(KC_HOME);
|
||||
unregister_code(KC_HOME);
|
||||
if (is_oneshot_layer_active() || layer_state & 0x2) {
|
||||
if (record->event.pressed)
|
||||
register_code(KC_HOME);
|
||||
else
|
||||
unregister_code(KC_HOME);
|
||||
clear_oneshot_layer_state(ONESHOT_START);
|
||||
}
|
||||
else {
|
||||
register_code(KC_PGUP);
|
||||
unregister_code(KC_PGUP);
|
||||
if (record->event.pressed)
|
||||
register_code(KC_PGUP);
|
||||
else
|
||||
unregister_code(KC_PGUP);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case KC_PENT:
|
||||
if (!numlock_on) {
|
||||
if (get_oneshot_layer() == 1 || layer_state & 0x2) {
|
||||
register_code(KC_END);
|
||||
unregister_code(KC_END);
|
||||
if (is_oneshot_layer_active() || layer_state & 0x2) {
|
||||
if (record->event.pressed)
|
||||
register_code(KC_END);
|
||||
else
|
||||
unregister_code(KC_END);
|
||||
clear_oneshot_layer_state(ONESHOT_START);
|
||||
}
|
||||
else {
|
||||
register_code(KC_PGDN);
|
||||
unregister_code(KC_PGDN);
|
||||
if (record->event.pressed)
|
||||
register_code(KC_PGDN);
|
||||
else
|
||||
unregister_code(KC_PGDN);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case KC_NLCK:
|
||||
/* Shift + NumLock will be treated as shift-Insert */
|
||||
if ((keyboard_report->mods & MOD_BIT (KC_LSFT)) || (keyboard_report->mods & MOD_BIT (KC_RSFT))) {
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_INS);
|
||||
unregister_code(KC_INS);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue