Right Shift: Can it have three functions?

Can the following be achieved with BTT? If so, might someone be able to outline the steps?

  • Short Press Mapping: r⇧ pressed and released alone, for <0.5 seconds, yields a short press and release of ⌃⌥⇧⌘ + keypad_8.

  • Long Press Mapping: r⇧ pressed and and held alone >0.5 seconds and released, yields a press, hold 0.5 seconds, and release of ⌃⌥⇧⌘ + keypad_8.

  • Preservation of Standard Behavior: Another key pressed while the r⇧ key is held down, yields the expected results (e.g., uppercase A).

With Karabiner Elements I'm able to achieve two of the three requirement, but not all three. For example, the following achieves Short Press Mapping and Preservation of Standard Behavior:

{
    "description": "Right ⇧ (if_alone) → ⌃⌥⇧⌘+[8] (with press/release gap)",
    "enabled": false,
    "manipulators": [
        {
            "from": {
                "key_code": "right_shift",
                "modifiers": { "optional": ["any"] }
            },
            "to": [
                {
                    "key_code": "right_shift",
                    "lazy": true
                }
            ],
            "to_if_alone": [
                {
                    "hold_down_milliseconds": 100,
                    "key_code": "keypad_8",
                    "modifiers": ["left_shift", "left_option", "left_control", "left_command"]
                }
            ],
            "type": "basic"
        }
    ]
}

Hi @jim-sauer

Three functions, yes. With key sequences.

A “sequence” consists of down and up. One is shorter, one is longer.

If you want to use shift “normally.” So, shift down, letter, shift up. Then the sequence is interrupted.

1 Like

This should work:
rshift2.bttpreset (8.6 KB)

long press:


short press

For the standard function no additional config is necessary because these key sequences will not be matched if another key is pressed inbetween

1 Like

@Andreas_Hegenberg, thanks so much for the incredibly quick reply. The information you provided was very helpful!

I did make a few modifications, most notably to short press.

  • In both triggers I changed the the action key from ⌃⌥⇧⌘+8 to ⌃⌥⇧⌘+keypad 8. Interestingly, notice how the Pad change is not reflected above or in the middle column.

  • In the short press, to more closely mimic a native keypress, I added a 0.02 sec (Async) Delay between a Key Down and a Key Up. (This change was necessary for hot key triggers in Keyboard Maestro. A similar gap is included in the Karabiner Elements configuration I shared above.)

  • Cosmetic Changes: a) I added comments to each trigger; and b) modified and disabled the Show HUD Overlays. BTW, I noticed that changes to the HUD are not immediately reflected if Preview HUD is selected. These changes were reflected as expected if I made a change, deselected the tigger, and reselected the trigger.


Here's the revised configuration: Right Shift (3 functions).bttpreset (10.7 KB)