I'm trying to make the control key backspace when pressed alone and also work as left control when combined with another key ( eg I use control h,j,k,l for up down left right), any help? for some reason, it's not working how I designed it.
-
How would this be able to determine when it being pressed alone or when you intend to use it as a modifier?– AllanCommented Apr 10, 2023 at 13:52
-
I assume OP wants it to work like the Windows key, where pressing it opens the start menu or pressing with another key activates a shortcut.– ma1234Commented Apr 10, 2023 at 14:44
Add a comment
|
1 Answer
I figured it out and made 2 versions 'control' had to be substituted for 'left_control':
{
"description": "control is backspace when pressed alone",
"manipulators": [
{
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 300,
"basic.to_if_held_down_threshold_milliseconds":0
},
"to_if_alone": [
{
"key_code": "delete_or_backspace"
}
],
"to_if_held_down": [
{
"key_code": "left_control"
}
],
"type": "basic"
}
]
}
{
"description": "Change control to control if pressed with other keys, to backspace if pressed alone.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "delete_or_backspace"
}
]
}
]
}
-
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.– ThinkrCommented Apr 10, 2023 at 19:04