Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifier shift do not work at to_if_canceled and to_if_invoked instructions #4094

Open
HgKls opened this issue Jan 9, 2025 · 1 comment
Open

Comments

@HgKls
Copy link

HgKls commented Jan 9, 2025

The rule below for a US-Int'l keyboard maps a double click on 'A' into an 'Ä'. In the to_if_canceled and to_if_invoked’ instructions, "key_code": "a", "modifiers": ["shift"] do not work, i.e. the modifier ‘shift’ is not sent, so that an 'a' is output instead of 'A'.
This misbehaviour is best seen if the parameter basic.to_delayed_action_delay_milliseconds is set to 2000 or higher.
Karabiner-Elements version: 15.3.13

{
    "description": "Ä if double-click on 'A' key (250ms)",
    "manipulators": [
        {
            "conditions": [
                {
                    "name": "A_pressed",
                    "type": "variable_if",
                    "value": true
                }
            ],
            "from": {
                "key_code": "a",
                "modifiers": { "mandatory": ["shift"] }
            },
            "to": [
                {
                    "set_variable": {
                        "name": "A_pressed",
                        "value": false
                    }
                },
                {
                    "key_code": "u",
                    "modifiers": ["right_option"]
                },
                {
                    "key_code": "a",
                    "modifiers": ["shift"]
                }
            ],
            "type": "basic"
        },
        {
            "from": {
                "key_code": "a",
                "modifiers": { "mandatory": ["shift"] }
            },
            "parameters": { "basic.to_delayed_action_delay_milliseconds": 250 },
            "to": [
                {
                    "set_variable": {
                        "name": "A_pressed",
                        "value": true
                    }
                }
            ],
            "to_delayed_action": {
                "to_if_canceled": [
                    {
                        "conditions": [
                            {
                                "name": "A_pressed",
                                "type": "variable_if",
                                "value": true
                            }
                        ],
                        "key_code": "a",
                        "modifiers": ["shift"]
                    },
                    {
                        "set_variable": {
                            "name": "A_pressed",
                            "value": false
                        }
                    }
                ],
                "to_if_invoked": [
                    {
                        "conditions": [
                            {
                                "name": "A_pressed",
                                "type": "variable_if",
                                "value": true
                            }
                        ],
                        "key_code": "a",
                        "modifiers": ["shift"]
                    },
                    {
                        "set_variable": {
                            "name": "A_pressed",
                            "value": false
                        }
                    }
                ]
            },
            "type": "basic"
        }
    ]
}
@HgKls HgKls changed the title modifiers shift do not work at to_if_canceled and to_if_invoked instructions Modifier shift do not work at to_if_canceled and to_if_invoked instructions Jan 9, 2025
@tekezo
Copy link
Member

tekezo commented Jan 27, 2025

@HgKls Thank you for feedback!
I fixed this issue at v 15.3.14. Please confirm the latest beta version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants