pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.59k stars 835 forks source link

Does not work on MacOS Catalina #1867

Closed phoffer closed 3 years ago

phoffer commented 5 years ago

When opening the KeyEventViewer, I am prompted to allow permission for "Input Monitoring" in the Privacy settings. This appears to be a new category. Opening Karabiner-Elements does not trigger this prompt. Even after manually adding Elements to the list, it still does not work.

Is there any other info I can provide or anything I can do to assist? I can attach my modifications if helpful, I have 1 simple and 1 complex. FWIW, Event Viewer does detect key presses.

EDIT: @saagarjha has figured out a workaround that gets it to work. Unless requested, I'll leave this open until it's officially fixed, hopefully that will help people find it.

Workaround: add /Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_grabber to the list.

Oh, and sudo killall karabiner_grabber.

saagarjha commented 5 years ago

I'm seeing TCC deny IOHIDDeviceOpen in the Console: let me see if there's a way to grant it permission for this.

saagarjha commented 5 years ago

Workaround: add /Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_grabber to the list.

phoffer commented 5 years ago

@saagarjha that did not work for me. I restarted Elements, do I need to restart my system for some reason? Just to confirm, did you add that to the Input Monitoring list?

saagarjha commented 5 years ago

Oh, and sudo killall karabiner_grabber.

tekezo commented 5 years ago

Thank you for feedback!

I guess you also have to do it with karabiner_observer though I didn't confirm this issue, yet. (I'll confirm soon.)

saagarjha commented 5 years ago

Yes, you do, based on the TCC warnings. I didn't care enough to add it, since it wasn't essential to getting Karabiner working (and sudo killall karabiner_observer, etc.)

grigoryvp commented 5 years ago

How to add anything into the "Input monitoring"? there is no "+" button like in other categories:

Screenshot 2019-06-04 at 08 02 14
saagarjha commented 5 years ago

@grigoryvp Try opening Karabiner-EventViewer.

Oyami-Srk commented 5 years ago

Adding karabiner_grabber works for me at first. But after I install the new version(12.4.8), It won't work. And doing the same thing to karabiner_observer make it work again. Apple's changing is make a lot of software unusable, LOL.

kAzec commented 5 years ago

For some reason the permission prompt is not showing up for me when I open Karabiner-EventViewer. And EventViewer says "EventViewer failed to observe keyboard devices". So I cannot find out a way to use saagarjha's method as stated above.

Anyway, turns out that you can add karabiner_grabber and karabiner_observer to Accessibility apps. And after sudo killall-ing both processes, Karabiner-Elements is working for me again.

grigoryvp commented 5 years ago

@grigoryvp Try opening Karabiner-EventViewer.

That helps, thanks!

grigoryvp commented 5 years ago

Update: "shell_command", like "open '/Applications/Safari.app'", stops working after few minutes. Keyboard rebinding countinues to work. Any way to troubleshoot "shell_command" issue? Some logs or anything?

yangchenlarkin commented 5 years ago

Workaround: add /Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_grabber to the list. @saagarjha I cannot add it to the list, because my System Preferences triggers an error. Do you know how can I add the app by terminals?

monsteryip commented 5 years ago

@grigoryvp Try opening Karabiner-EventViewer.

thx!!!

saagarjha commented 5 years ago

@yangchenlarkin I doubt there's an easy way to do this from the Terminal, since it would obviate the need for TCC in the first place.

mkleehammer commented 5 years ago

So I followed the instructions here and it worked for a while, but stops working at some point. It might be when it goes to sleep - I haven't noticed the pattern yet. Using sudo killall on grabber and observer, then restarting KE works.

First, any idea why it might stop working?

Second, while the workaround is necessary, what's the smallest subset that should work? Just killing grabber? What restarts grabber? Does it restart on its own while the KE gui is running or does restarting the GUI do that? (I haven't dug in yet. Sorry if this is an obvious question.)

sean-clayton commented 5 years ago

For me, my caps_lock -> left_command + left_control + left_option keybind no longer works in 10.15 beta (karabiner elements version 12.4.8).

I followed the instructions, but still not working :(

EDIT: After following these steps it did work! https://github.com/tekezo/Karabiner-Elements/issues/1867#issuecomment-498556572

grigoryvp commented 5 years ago

It stops working for me after some time, too

saagarjha commented 5 years ago

@mkleehammer I can reproduce your error, as well as the "fix" you've suggested. I'm getting a new error in the log this time: grabber_client error: Connection reset by peer. @tekezo any ideas what would be causing this?

cumanzor commented 5 years ago

It stops working for me after some time, too

It seems to stop working when disconnecting / connecting an external usb keyboard for me. My temp workaround is restarting the grabber service: sudo killall karabiner_grabber

Lumisilk commented 5 years ago

Same problem here. Using workaround is helpful for a while but become not working after some time. Trying reinstall karabiner, delete and add grabber to Settings again, still can't work. Log has some records: [warning] [grabber] (my all external mouse and keyboard) is not observed yet. Please wait for a while.

fangk commented 5 years ago

my System Preferences triggers an error

login Guest and create another user in same group, new user won't trigger error and the setting is for group.

YOnoda commented 5 years ago

I had the problems as @saagarjha mentions, but after reinstalling Karabiner-Elements from scratch worked like a charm.

activaigor commented 5 years ago

super working solution! thanks for sharing it!

activaigor commented 5 years ago

super working solution! thanks for sharing it!

kylekeesling commented 5 years ago

Running on Catalina Beta 2:

In order to fix the F-key/media playback buttons, I needed to add the following entries to the Security & Privacy > Privacy > Input Monitoring list:

Hope that helps anyone else that may have been still struggling!

Lumisilk commented 5 years ago

Follow @kylekeesling 's advice, add not only grabber but also observer to Input Monitoring, it works again... Magic. Thanks!

Update: not working again

leowu4ever commented 5 years ago

Running on Catalina Beta 2:

In order to fix the F-key/media playback buttons, I needed to add the following entries to the Security & Privacy > Privacy > Input Monitoring list:

  • /Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_grabber
  • /Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_observer

Hope that helps anyone else that may have been still struggling!

Can't locate org.pqrs in my drive. Is there anything wrong with my installation? I reinstalled it

oschrenk commented 5 years ago

Had to combine some steps from this step to make it work for. It will still be broken after waking up from sleep (see below for details). Works good enough for me until the amazing @tekezo can fix it for good - waiting for the Github sponsoring opportunity for this repo )

I needed to open Karabiner-EventViewer.app prompts me to add permission for Karabiner-EventViewer.app in the “Input Monitoring” category of “System Preferences > Security & Privacy > Privacy” settings. I could not add anything to that category before.

( thanks @saagarjha )

I then added

/Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_grabber
/Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_observer

( thanks @kylekeesling )

to that list and then I had to restart both processes. I do this using

or simply

sudo killall karabiner_observer karabiner_grabber

You have to do that every time your machine wakes up from sleep.

Edit ::

Prior method to kill the processes was

ps -ef | egrep karabiner_observer\|karabiner_grabber | grep -v grep |  awk '{print $2}' | xargs -I _ sudo kill _

Thanks @humblehacker . I think I just did killall karabiner_observer first which couldn't find the process. Then I constructed the complicated solution above, without thinking that it actually just needed sudo

nikitavoloboev commented 5 years ago

waiting for the Github sponsoring opportunity for this repo

No need to wait. You can donate already.

https://pqrs.org/osx/karabiner/pricing.html

But I agree, I would love to have a monthly payment for Karabiner to @tekezo either with Patreon or GitHub.

pbassham commented 5 years ago
ps -ef | egrep karabiner_observer\|karabiner_grabber | grep -v grep |  awk '{print $2}' | xargs -I _ sudo kill _

This worked for me on beta 2 when nothing else did

mkleehammer commented 5 years ago

Same as above. Since I expect there will be a decent fix available sometime, I didn't spend a lot of time automating but I got this working.

First, I compiled WakeWatcher and put it in my path.

It runs a script named ~/.onwake if it exists and is executable, so I created and and put the command above into it:

#!/bin/sh
ps -ef | egrep karabiner_observer\|karabiner_grabber | grep -v grep |  awk '{print $2}' | xargs -I _ sudo kill _

This works great, but I have to run WakeWatcher once after logging in. I always have a terminal open so I run WakeWatcher & and it runs in the background. I briefly tried automating this part with Login Items and launchd but didn't find a quick satisfactory solution.

humblehacker commented 5 years ago

Wouldn't this work just as well?

sudo killall karabiner_observer karabiner_grabber
mkleehammer commented 5 years ago

Wouldn't this work just as well?

sudo killall karabiner_observer karabiner_grabber

That's what I used initially, but I wanted something that didn't require sudo for the automated solution.

jojonki commented 5 years ago

This workwround (adding karabiner_graber and karabiner_observer) worked in my environment :). Probably, Catalina and Karabiner are the latest so far.

olbrichj commented 5 years ago

macOS Catalina 10.15 Beta 3 Karabiner-Elements: 12.5.0

works fine after adding both to the security settings. Survives a restart

An older version had problems after a few minutes with the mapping. Sometimes even after a restart.

r3volution11 commented 5 years ago

FYI, in addition to sleep, the problem also occurs when connecting a new keyboard, wired or bluetooth for me. Killing the two tasks after connecting fixes the problem as well.

vtenfys commented 5 years ago

For me, this fixed the problem:

  1. Add karabiner_grabber and karabiner_observer to the input monitoring whitelist:

    image

  2. Run sudo killall karabiner_observer karabiner_grabber and wait ~10 seconds

I'm running macOS 10.15 Public Beta 2

Edit: also add karabiner_kextd to the input monitoring whitelist if you want capslock LED support

kushagra391 commented 5 years ago

+1 to @davidbailey00. sudo killall karabiner_observer karabiner_grabber worked for me sudo killall karabiner_grabber alone doesnt work on catalina beta 3

willyuewu commented 5 years ago

also +1 to @davidbailey00 add those executables with permission and then restart them makes perfect sense. Doing those on macOS Catalina 19A501i (beta 3).

But weirdly, I mainly us Karabiner for quick opening apps on the mac. All the third party apps I can still use Karabiner to launch them, but Apple apps (other than finder folders) are all inactive (like calendar, messages, console ...)

It also seems that after some typing (not sure at all), the app will stop translating the key press to complex modifications.

r3volution11 commented 5 years ago

@willyuewu Apple apps are now in /System/Applications. The ones in /Applications folder appear to be something like symlinks. That could be your problem regarding Apple apps.

willyuewu commented 5 years ago

@willyuewu Apple apps are now in /System/Applications. The ones in /Applications folder appear to be something like symlinks. That could be your problem regarding Apple apps.

That works! THX!!

And it seems when Karabiner fails, do sudo killall karabiner_observer karabiner_grabber can make it work.

onep1usone commented 5 years ago

macOS Catalina 10.15 Beta 3 Karabiner-Elements: 12.5.0

works fine after adding both to the security settings. Survives a restart

An older version had problems after a few minutes with the mapping. Sometimes even after a restart.

I have found that when you run an update ie move from beta 1 > beta 2 or beta 2 > beta 3 these get wiped and you have to add them again

onep1usone commented 5 years ago

macOS Catalina 10.15 Beta 3 Karabiner-Elements: 12.5.0 works fine after adding both to the security settings. Survives a restart An older version had problems after a few minutes with the mapping. Sometimes even after a restart.

I have found that when you run an update ie move from beta 1 > beta 2 or beta 2 > beta 3 these get wiped and you have to add them again

Scratch that every time i unplug my keyboard from my laptop i have to run sudo killall karabiner_observer karabiner_grabber

tekacs commented 5 years ago

I currently have to run sudo killall karabiner_observer karabiner_grabber every time I return to my MacBook Pro after locking it - on Catalina public beta, with all current updates applied.

hologerry commented 5 years ago

Complex modifications caps_lock to command+control+option+shift doesn't work on macOS 10.15 beta 4 (19A512f), tried the workaround.

[2019-07-17 12:21:53.637] [info] [grabber] Load /Users/Gerry/.config/karabiner/karabiner.json...
[2019-07-17 12:21:53.637] [info] [console_user_server] Load /Users/Gerry/.config/karabiner/karabiner.json...
[2019-07-17 12:21:53.639] [info] [grabber] core_configuration is updated.
[2019-07-17 12:21:53.639] [info] [console_user_server] core_configuration is updated.
[2019-07-17 12:21:53.640] [warning] [grabber] Apple Internal Keyboard / Trackpad (device_id:4294968891) is not observed yet. Please wait for a while.
[2019-07-17 12:21:53.640] [warning] [grabber] Apple Internal Keyboard / Trackpad (device_id:4294968885) is not observed yet. Please wait for a while.
willyuewu commented 5 years ago

Just updated to beta 4. The trick still works but now it lasts even shorter. However, now the app can capture my input all the time instead of stop working entirely. But it just can't launch the functions should be triggered by my input.

kotobuki commented 5 years ago

I have been using 12.5.0, and I also updated to beta 4 (19A512f) yesterday. So far, I don't have to use the trick. On the previous beta, I had to use the trick after each unlocking.

FBeccaria commented 5 years ago

I tried the trick and it does not work (added k..grabber and k..observer to Input Monitor list and terminated both in Terminal with sudo killall several times). I am running version 12.5.3 and latest 10.15 Beta (19A512f).

bomtailey commented 5 years ago

Ditto with @FBeccaria. I added grabber and observer also to the accessibility list and no luck. The log continues to report "[warning] [grabber] Microsoft Sculpt Comfort Mouse (device_id:4294969413) is not observed yet. Please wait for a while."