- Change the key event. (For example, "Change Right Option to Enter")
- Change the consumer key event. (The consumer key is the functional key such as "Volume Down")
- Change the pointing event. (For example, "MiddleClick to Expose")
- The key repeat function.
- Add private setting dynamically by private.xml.
- Filtering by application or input source or specific device, etc.
- Send Growl notification. (The status of Modifier Lock and extra messages.)
- Support to "Fast User Switching".
- PreferencePane in System Preferences.
- Check software updates automatically
See http://pqrs.org/macosx/keyremap4macbook/source.html
- KeyRemap4MacBook.kext (Kernel Extension)
- KeyRemap4MacBook_server.app (Userspace Application)
- KeyRemap4MacBook.app (Updater)
- KeyRemap4MacBook.prefPane (PreferencePane)
To prevent leakage of the input event, the modification of the input event is perfomed inside kernel entirely.
We set a hook function in the middle of hardware driver. And we modify the input event in the hook function.
...
We use a global lock to guard the status of modifier flags, the status of buttons, and other global variables. All threads use this global lock. The only one thread runs at the same time.
Threads:
- Timer callback (*_timer_callback)
- hooked function (EventInputQueue::push_*)
- gIOMatchedNotification and gIOTerminatedNotification callback of input devices (Core::*Notification_callback)
- IOUserClient callback (UserClient_kext::callback_*)