[GH-ISSUE #129] Seems Mojave broke the app #106

Closed
opened 2026-05-05 04:55:50 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @dimitrisfasoulas on GitHub (Nov 30, 2018).
Original GitHub issue: https://github.com/keycastr/keycastr/issues/129

This is the first time I try this app so it might be something else that is causing this to fail.

I'm trying to open the app on a MacBook Pro (Retina, 15-inch, Mid 2015) with Mojave installed and 2 extra screens connected.

I installed the app with brew

brew cask info keycastr                                                                                                                                                                             ✔  0.18   08:06:59
keycastr: 0.9.6
https://github.com/keycastr/keycastr
/usr/local/Caskroom/keycastr/0.9.6 (64B)
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/keycastr.rb
==> Name
KeyCastr
==> Artifacts
KeyCastr.app (App)

After I add the app to Preferences -> Security & Privacy -> Accessibility I try to run the app and I get the following screen:

screenshot 2018-11-30 at 08 14 12

If after this I go again to Preferences -> Security & Privacy -> Accessibility the list is empty (although I had other apps there as well) and I can not add apps (I press the + sign I go through the motions of adding an app but nothing appears).
image

A reboot will fix the pane but if I try again I get the same results.

If you generate logs anywhere, let me know and I grab them.

Originally created by @dimitrisfasoulas on GitHub (Nov 30, 2018). Original GitHub issue: https://github.com/keycastr/keycastr/issues/129 This is the first time I try this app so it might be something else that is causing this to fail. I'm trying to open the app on a MacBook Pro (Retina, 15-inch, Mid 2015) with Mojave installed and 2 extra screens connected. I installed the app with brew ``` brew cask info keycastr  ✔  0.18   08:06:59 keycastr: 0.9.6 https://github.com/keycastr/keycastr /usr/local/Caskroom/keycastr/0.9.6 (64B) From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/keycastr.rb ==> Name KeyCastr ==> Artifacts KeyCastr.app (App) ``` After I add the app to Preferences -> Security & Privacy -> Accessibility I try to run the app and I get the following screen: <img width="420" alt="screenshot 2018-11-30 at 08 14 12" src="https://user-images.githubusercontent.com/11027314/49274255-0c097780-f478-11e8-900c-c3b1edf742df.png"> If after this I go again to Preferences -> Security & Privacy -> Accessibility the list is empty (although I had other apps there as well) and I can not add apps (I press the + sign I go through the motions of adding an app but nothing appears). ![image](https://user-images.githubusercontent.com/11027314/49274363-630f4c80-f478-11e8-8af1-e3225d4854fe.png) A reboot will fix the pane but if I try again I get the same results. If you generate logs anywhere, let me know and I grab them.
Author
Owner

@NicholasTD07 commented on GitHub (Dec 19, 2018):

For anyone following this thread, I have a half-assed fix but it works.

Add the following

    NSDictionary *options = @{(__bridge id) kAXTrustedCheckOptionPrompt : @YES};
    BOOL accessibilityEnabled = AXIsProcessTrustedWithOptions((__bridge CFDictionaryRef) options);

    if (!accessibilityEnabled) {
        if (error != NULL) {
            *error = [self constructErrorWithDescription:@"Could not create keyDown event tap!"];
        }
        return NO;
    }

to KCKeyboardTap.m, in this method -(BOOL) installTapWithError:(NSError **)error {.

So it looks like this

-(BOOL) installTapWithError:(NSError **)error {
    if (tapInstalled) {
        return YES;
    }

    NSDictionary *options = @{(__bridge id) kAXTrustedCheckOptionPrompt : @YES};
    BOOL accessibilityEnabled = AXIsProcessTrustedWithOptions((__bridge CFDictionaryRef) options);

    if (!accessibilityEnabled) {
        if (error != NULL) {
            *error = [self constructErrorWithDescription:@"Could not create keyDown event tap!"];
        }
        return NO;
    }
<!-- gh-comment-id:448784464 --> @NicholasTD07 commented on GitHub (Dec 19, 2018): For anyone following this thread, I have a half-assed fix but it works. Add the following ```objc NSDictionary *options = @{(__bridge id) kAXTrustedCheckOptionPrompt : @YES}; BOOL accessibilityEnabled = AXIsProcessTrustedWithOptions((__bridge CFDictionaryRef) options); if (!accessibilityEnabled) { if (error != NULL) { *error = [self constructErrorWithDescription:@"Could not create keyDown event tap!"]; } return NO; } ``` to KCKeyboardTap.m, in this method `-(BOOL) installTapWithError:(NSError **)error {`. So it looks like this ```objc -(BOOL) installTapWithError:(NSError **)error { if (tapInstalled) { return YES; } NSDictionary *options = @{(__bridge id) kAXTrustedCheckOptionPrompt : @YES}; BOOL accessibilityEnabled = AXIsProcessTrustedWithOptions((__bridge CFDictionaryRef) options); if (!accessibilityEnabled) { if (error != NULL) { *error = [self constructErrorWithDescription:@"Could not create keyDown event tap!"]; } return NO; } ```
Author
Owner

@XinyuYe commented on GitHub (Jan 12, 2019):

You can add it manually by clicking the small "+" button in the accessibility.

<!-- gh-comment-id:453772130 --> @XinyuYe commented on GitHub (Jan 12, 2019): You can add it manually by clicking the small "+" button in the accessibility.
Author
Owner

@akitchen commented on GitHub (Jan 13, 2019):

I always drag it into the list after clicking +, as mentioned above.

just verified this works fine on a fresh install of Mojave. closing...

<!-- gh-comment-id:453805114 --> @akitchen commented on GitHub (Jan 13, 2019): I always drag it into the list after clicking +, as mentioned above. just verified this works fine on a fresh install of Mojave. closing...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/keycastr#106
No description provided.