How to monitor keyboard input?

Helloooo. It’s been a while to touch Elixir.
Is it possible to make a MacOS application which monitors user’s keyboard input like Raycast. I just want to see how many types I have during one day. and I want to make a simple app like that. so I am looking for some hints to make it true. thank you!

As always “it depends”. Elixir can likely interact with tooling, which would allow you to track your keyboard, but it cannot do so on its own. You always need some integration layer with your OS to do that kind of stuff.

okay, thank you for your reply!
it cannot do it only by itself. i will try to research about the tools more. thanks!

Here is a simple example that can be adapter for your use-case: GitHub - caseyscarborough/keylogger: A no-frills keylogger for macOS.

Personally, I would rewrite the application to log the keystrokes in console and use Port to receive the keystroke events into your erlang runtime.

1 Like

ohh thank you! let me take a look into it :pray: