Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- switch(keycode) {
- case KC_LBRC: //if keycode is [
- case KC_RBRC: //or keycode is ]
- if (record->event.pressed) { //if this is a keydown event
- if (get_mods() & MOD_MASK_SHIFT) { //if a shift key is held
- uint8_t temp_mods = get_mods(); //store the current mods that are held
- del_mods(MOD_MASK_SHIFT); //ignore both shift keys
- tap_code(keycode); //tap the key without shift, types a [ or ]
- set_mods(temp_mods); //add back shift key(s)
- } else { //if shift is not held
- tap_code16(LSFT(keycode)); //tap the key with shift, types a { or }
- }
- }
- return false; //do not process the key as normal
- case MACRO1: //other macro code
- //...
- break;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement