如何钩住OS X字典 [英] How to hook the OS X dictionary
本文介绍了如何钩住OS X字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在osx狮子,你可以控制命令d或三击你的鼠标指向任何应用程序中的字,以启动一个popover字典。我想让一个应用程序来跟踪用户在字典中查找的字词。
on osx lion, you can control-command-d or triple-tap on a word that your mouse is pointed to in any app to launch a popover dictionary. i want to make an app to track the words a user is looking up in the dictionary.
我如何观察用户执行control-command-d的事件三次点按以启动popover字典?
how do i observe the event where the user does control-command-d or triple-tap to launch the popover dictionary?
我知道这个特定的API是 HIDictionaryWindowShow 。
I understand that the specific API for this is HIDictionaryWindowShow.
推荐答案
可以使用 popoverDidShow:
- (void)awakeFromNib {
NSNotificationCenter* notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self selector:@selector(popoverDidShow:)
name:NSPopoverDidShowNotification object:nil];
}
// dictionary is shown or another NSPopover
- (void)popoverDidShow:(NSNotification*)notify {
//your code
}
这篇关于如何钩住OS X字典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文