如何在浏览器或文本编辑器中监视OSX上的双击(文本选择) [英] How to monitor double click (text selection) on OSX in browser or text editor

查看:137
本文介绍了如何在浏览器或文本编辑器中监视OSX上的双击(文本选择)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新手程序员在堆栈溢出问题时提出第一个问题。我正在为mac osx编写一个应用程序,用于监视文本选择,即当用户双击某些文本时。文本可以来自浏览器或文本编辑器等。目标是捕获文本并对文本进行一些处理。

Novice programmer asking first question on stack-overflow. I am writing an app for mac osx that monitors for text selection ie when a user does a double click on some text. The text can come from a browser or text editor, etc. The goal is to capture the text and do some processing on the text.

我一直在阅读关于鼠标和在mac库中的游标事件,但似乎没有回答我的问题和谷歌搜索让我失落了。
http://开发人员。 apple.com/mac/library/documentation/Cocoa/Conceptual/EventOverview/MouseTrackingEvents/MouseTrackingEvents.html

I been reading about the mouse and cursor events in mac library but doesn't seem to answer my questions and googling around leaving me bit lost. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/EventOverview/MouseTrackingEvents/MouseTrackingEvents.html

任何人大师想分享哪里可以找到回答?任何指导将不胜感激! :

Anyone guru want to share where I can find the answer? Any guidance will be appreciated! :)

谢谢!

推荐答案

从应用程序,用户正在使用的其他应用程序。如果您想提供操作其他应用程序中所选文本的内容,请使用系统服务。所有你需要做的是提供消耗所选文本的功能; OS X自动执行所有监控,将所选文本传递到您的应用程序等。

You can't monitor from an app what the user is doing with some other app. If you want to provide something which manipulates selected texts in other apps, use System Services. All you have to do is to provide the function which consumes the selected texts; OS X automatically does all the monitoring, passing of the selected text to your app etc.

从10.6开始,系统服务也会出现在上下文菜单中。

Starting with 10.6, system services also appear in the context menu.

这篇关于如何在浏览器或文本编辑器中监视OSX上的双击(文本选择)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆