site_archiver@lists.apple.com Delivered-To: Darwin-kernel@lists.apple.com Hi, thanks, Rob _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I'm trying to write a kernel extension that remaps certain keys for a certain application. (Specifically, I want to switch Command and Option in Terminal.app. The system preferences let you do this, but only for all applications.) I haven't written kernel extensions before. I've got one working that can remap keys for all applications. I did this by putting new functions in the _keyboardEventAction fields in the IOHIKeyboard objects. The new function changes the arguments before passing them through to the original _keyboardEventAction. Now, the missing piece... how can I find out which application is in the foreground? This email sent to site_archiver@lists.apple.com