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

caps_lock -> control or command depending on frontmost application #4042

Open
b3nj1 opened this issue Dec 4, 2024 · 6 comments
Open

caps_lock -> control or command depending on frontmost application #4042

b3nj1 opened this issue Dec 4, 2024 · 6 comments

Comments

@b3nj1
Copy link

b3nj1 commented Dec 4, 2024

I have a very old complex modification that I've used for several years. It's still working for me on an M1 MacBook Pro running Monterey. On an M3 MacBook Air running Sequoia, works for a little while on Sequoia, but later stops until I reboot.

This is a shared laptop with multiple users logged in at the same time. That has been fine under older versions of macOS on different machines, but thought I'd mention it in case it's a factor.

When I say it stops, Caps Lock has no observable effect. It doesn't act as Control, Command, or even as Caps Lock. It's a no-op.

I've tried:

  • Adding "hold_down_milliseconds": 100 but I'm not sure it applies in this usage. It didn't help the issue.
  • Changing the keyboard modifier keys in the system settings to make Caps Lock as "No Action" or as "Caps Lock". Either way have similar behavior: Work for a while, then stop.
image

My full modification is below.

Any help would be appreciated. I've tried searching other issues including closed ones, but haven't found the key yet.

I am very dependent on this muscle memory!
Thanks!

{
    "description": "Command/Control",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^org\\.gnu\\.Emacs$",
                        "^org\\.gnu\\.AquamacsEmacs$",
                        "^org\\.gnu\\.Aquamacs$",
                        "^org\\.pqrs\\.unknownapp.conkeror$",
                        "^com\\.microsoft\\.rdc$",
                        "^com\\.microsoft\\.rdc\\.mac$",
                        "^com\\.microsoft\\.rdc\\.osx\\.beta$",
                        "^net\\.sf\\.cord$",
                        "^com\\.thinomenon\\.RemoteDesktopConnection$",
                        "^com\\.itap-mobile\\.qmote$",
                        "^com\\.nulana\\.remotixmac$",
                        "^com\\.p5sys\\.jump\\.mac\\.viewer$",
                        "^com\\.p5sys\\.jump\\.mac\\.viewer\\.web$",
                        "^com\\.vmware\\.horizon$",
                        "^com\\.2X\\.Client\\.Mac$",
                        "^com\\.apple\\.Terminal$",
                        "^com\\.googlecode\\.iterm2$",
                        "^co\\.zeit\\.hyperterm$",
                        "^co\\.zeit\\.hyper$",
                        "^org\\.vim\\.",
                        "^com\\.vmware\\.fusion$",
                        "^com\\.vmware\\.horizon$",
                        "^com\\.vmware\\.view$",
                        "^com\\.parallels\\.desktop$",
                        "^com\\.parallels\\.vm$",
                        "^com\\.parallels\\.desktop\\.console$",
                        "^org\\.virtualbox\\.app\\.VirtualBoxVM$",
                        "^com\\.vmware\\.proxyApp\\.",
                        "^com\\.parallels\\.winapp\\.",
                        "^org\\.x\\.X11$",
                        "^com\\.apple\\.x11$",
                        "^org\\.macosforge\\.xquartz\\.X11$",
                        "^org\\.macports\\.X11$"
                    ],
                    "type": "frontmost_application_unless"
                }
            ],
            "from": {
                "key_code": "caps_lock",
                "modifiers": { "optional": ["any"] }
            },
            "to": [
                {
                    "key_code": "left_command",
                    "lazy": true
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^org\\.gnu\\.Emacs$",
                        "^org\\.gnu\\.AquamacsEmacs$",
                        "^org\\.gnu\\.Aquamacs$",
                        "^org\\.pqrs\\.unknownapp.conkeror$",
                        "^com\\.microsoft\\.rdc$",
                        "^com\\.microsoft\\.rdc\\.mac$",
                        "^com\\.microsoft\\.rdc\\.osx\\.beta$",
                        "^net\\.sf\\.cord$",
                        "^com\\.thinomenon\\.RemoteDesktopConnection$",
                        "^com\\.itap-mobile\\.qmote$",
                        "^com\\.nulana\\.remotixmac$",
                        "^com\\.p5sys\\.jump\\.mac\\.viewer$",
                        "^com\\.p5sys\\.jump\\.mac\\.viewer\\.web$",
                        "^com\\.vmware\\.horizon$",
                        "^com\\.2X\\.Client\\.Mac$",
                        "^com\\.apple\\.Terminal$",
                        "^com\\.googlecode\\.iterm2$",
                        "^co\\.zeit\\.hyperterm$",
                        "^co\\.zeit\\.hyper$",
                        "^org\\.vim\\.",
                        "^com\\.vmware\\.fusion$",
                        "^com\\.vmware\\.horizon$",
                        "^com\\.vmware\\.view$",
                        "^com\\.parallels\\.desktop$",
                        "^com\\.parallels\\.vm$",
                        "^com\\.parallels\\.desktop\\.console$",
                        "^org\\.virtualbox\\.app\\.VirtualBoxVM$",
                        "^com\\.vmware\\.proxyApp\\.",
                        "^com\\.parallels\\.winapp\\.",
                        "^org\\.x\\.X11$",
                        "^com\\.apple\\.x11$",
                        "^org\\.macosforge\\.xquartz\\.X11$",
                        "^org\\.macports\\.X11$"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "caps_lock",
                "modifiers": { "optional": ["any"] }
            },
            "to": [
                {
                    "key_code": "left_control",
                    "lazy": true
                }
            ],
            "type": "basic"
        }
    ]
}
@tekezo
Copy link
Member

tekezo commented Dec 4, 2024

This setting is working fine on my end.
Could you check the modifier keys for the virtual keyboard in System Settings?

https://karabiner-elements.pqrs.org/docs/help/troubleshooting/breaking-changes/#modifiers

@b3nj1
Copy link
Author

b3nj1 commented Dec 4, 2024

Thanks for the help! My settings match the values from the troubleshooting guide.

image

@tekezo
Copy link
Member

tekezo commented Dec 5, 2024

Thanks, the modifier settings seem to be fine. Another possibility is that the device is excluded from Karabiner-Elements. Please take a look at the settings.
https://karabiner-elements.pqrs.org/docs/manual/configuration/configure-devices/

@b3nj1
Copy link
Author

b3nj1 commented Dec 13, 2024

The remapping has been working for a couple of days, but today, it working stopped again.

In the "not working" state, my device is still included:

image

@b3nj1
Copy link
Author

b3nj1 commented Dec 13, 2024

While the remapping was in the "not working" condition, I used the Activity Monitor to force quit all Karabiner processes. They started themselves back up, and my remap started working again. At least I know how to work around this.

Is there something I can/should enable to help further debug why it stops working?

@DavidLGoldberg
Copy link

I have the exact same symptom of:
"works for a little while on Sequoia, but later stops until I reboot"

My Karabiner-Viewer is only registering mouse up and down events.

I tried the Activity Monitor, searching for 'karabiner' and force quitting those did NOT work for me.

I also tried kill -9, got new PIDs but that didn't work either.

NOTE: At some point I got to a state where the Karabiner menu's quit stopped quitting the app at all (as did Force Quit via activity monitor!)

Some digging on previous issues & some GPT, I got this to finally work:

launchctl bootout gui/$(id -u)/org.pqrs.service.agent.karabiner_grabber &&
launchctl bootout gui/$(id -u)/org.pqrs.service.agent.karabiner_console_user_server &&
launchctl bootout gui/$(id -u)/org.pqrs.service.agent.karabiner_session_monitor

Although, ironically this didn't just stop karabiner, but got my hotkeys working. It must have just restarted! Luckily, all I wanted was for my bindings to work again :)

BTW, as expected, after entering this "fixed" state via the 3 commands above the event viewer is functioning again.

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

No branches or pull requests

3 participants