Skip to content

Conversation

@tekacs
Copy link

@tekacs tekacs commented Sep 28, 2025

  • special-case "fn" bindings via rdev listener so mac users can use Fn
  • reuse shortcut dispatcher to drive existing push-to-talk/toggle flow
  • expose Use Fn button on mac settings and keep Cmd glyph formatting

- special-case "fn" bindings via rdev listener so mac users can use Fn
- reuse shortcut dispatcher to drive existing push-to-talk/toggle flow
- expose Use Fn button on mac settings and keep Cmd glyph formatting
@akshar-dave
Copy link

🙏🏻

@cjpais
Copy link
Owner

cjpais commented Sep 28, 2025

Thanks for this I'll give it a look and test. Do you know if you tauri build the release does it require extra permissions for rdev on MacOS? The initial versions of Handy used rdev and a custom global keyboard shortcut library, but required extra permissions

@tekacs
Copy link
Author

tekacs commented Sep 28, 2025

Hmmmm. I have it using input monitoring – is that something that you have in your main branch(es) as well?

@cjpais
Copy link
Owner

cjpais commented Sep 28, 2025

Yeah that was actually the reason I moved away from it. I felt like it might feel too much like a key-logger or something which I was hesitant to add the permission for

@tekacs
Copy link
Author

tekacs commented Sep 28, 2025

I hear that – the thing is that I think it's... almost necessary? For push-to-talk, holding two keys is distinctly less than ideal.

Interestingly, both Wispr Flow and VoiceInk don't use that permission, so it's likely spurious? If I get a chance I'll investigate why.

@cjpais
Copy link
Owner

cjpais commented Sep 28, 2025

Right, I've been trying to figure that out as well. I used MacWhisper for a while and don't recall the permission either. There must be some system native way of doing this

- remove rdev-based CGEvent tap and switch to NSEvent flagsChanged monitor so Fn capture only uses accessibility permission
- add objc2/block2 dependencies and thread-local monitor plumbing
- refresh docs to describe the new approach
@tekacs
Copy link
Author

tekacs commented Oct 3, 2025

@cjpais this now works using only Accessibility permissions – tested by removing the Input Monitoring permission and using fn successfully. Should supersede #163 too.

@cjpais
Copy link
Owner

cjpais commented Oct 4, 2025

Let's go, thank you! I cannot wait to test it. Hopefully I'll be able to on Tuesday and pull it in. Thanks

@cjpais
Copy link
Owner

cjpais commented Oct 7, 2025

I tested this, however, I haven't looked at the code thoroughly yet. I do see that this only supports the function key. It would be really cool to move the entire code to use this general method of input detection on Mac OS, and move away from using the Tauri Global shortcut. This is so we have consistent behavior on Mac OS

Ideally can also detect fn in the frontend instead of adding a UI button. I don't really want that UI button to exist, the user should just be able to click the keyboard ideally. I would think javascript can get the keycode and we might just need to map it. I believe the other PR supports that however I have not tested it

@dannysmith
Copy link
Collaborator

@cjpais Where's the best place to discuss this at the mo? Feels like there are a bunch of issues/PRs/discussions about handling keyboard shortcuts.

My tuppence...

  • I'd very much like to use fn as my PTT trigger on macOS.
  • Other people seem very keen on all sorts of other key mappings for PTT/persistent or plain/translated/LLM-enriched etc etc etc.
  • Supporting complex keymappings via a not-horrible UI is likely to take a little thought. I wonder if it'd make more sense to support more complex keymappings via user editing of settings_store.json or some other config file?

Related...

I'd also like the ability to disable Handy's shortcuts when certain apps are focussed (ie those with conflicting app-local keybinds)

@cjpais
Copy link
Owner

cjpais commented Nov 20, 2025

I'm very happy to support mappings through json right now and I think that's a good tradeoff before UI comes in.

In regards to handling more keybinding generally I think we can do it here or in an issue if there is one. I really want this one to come in as well it just needs testing and validation that it won't require special perms on macOS, and it should be generalized beyond the fn or globe key I think to support any binding within reason

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

Successfully merging this pull request may close these issues.

4 participants