As a way to learn the MacOS Cocoa API and Swift, I set out to write a MacOS system tray app that would provide IBM Model M “clicky” keyboard sound effects whenever the OS detected a key up or down event.
To my complete surprise I was able to get a functional app working within an afternoon, which goes to prove that the ecosystem for writing MacOS apps is well designed and mature.
Version 1.0 of the app is a system tray app, meaning that it runs in the background once started and does not appear in the Dock. There are 3 distinct sound effect libraries: - IBM Model M sounds - iOS button sound - generic mechanical typewriter sounds
These can be chosen from the system tray menu.
How to download and use
- Download the
keydings.app.zipfile from https://github.com/jsyang/keydings/releases/tag/1.0
- Extract and move
keydings.appfile somewhere, like in
- Open “Security & Privacy” panel in System Preferences (Cmd+Space, then type “Security & Privacy”)
- Click on the “Privacy” tab then on Accessibility in the left hand menu.
- Click on the lock to enable changes to this section: on the right hand side you will see a list of apps with Accessibility access.
- Drag the
keydings.appfile into this list, this will enable the app to listen for keyDown and keyUp events across the OS.
- Then double click the
/Applicationsto run it. You should see a music note icon in the MacOS system tray.
The source code for the app can be found here: https://github.com/jsyang/keydings
You will need an up to date version of XCode to open the project.