Skip to content

Feature request: [macOS] Check for Input Monitoring permission and request on first startup #1743

@maxRN

Description

@maxRN

Is your feature request related to a problem? Please describe.

Since kanata needs to listen to all user input, it needs the "Input Monitoring" permission on MacOS. If a user doesn't know about this or forgets to add it, then it leads to confusing error messages.

Describe the solution you'd like.

  1. Check if user has granted permission. If permission is not granted print error message, maybe along with URL to installation instructions.
  2. Even better: on startup request permission using native APIs, this should open a dialog where users can grant permission.

Describe alternatives you've considered.

Alternatives for users is to grant Input Monitoring permissions to their terminal or shell and I think that way if they launch kanata through that, it will inherit the permissions. Again, I'm not 100% sure this is actually true, I haven't found a definitive source on that.

Additional context

Also another open issue is that after each update of kanata, users need to re-grant Input Monitoring permissions. I'm not sure how other applications deal with this (especially Karabiner), but they might use something like a launcher application that starts the actual kanata binary. I think TCC permissions (like Input Monitoring) are passed through to child processes, but I'm not 100% sure.

Here is a link from SO which discusses checking and asking for permissions: https://stackoverflow.com/questions/79010369/how-to-check-the-status-of-the-input-monitoring-permission-in-my-swift-based-m

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmacosIssue pertains to macos; jtroo has no macOS devices and does not maintain the support for this OS.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions