OSX上的键盘输入 [英] Keyboard input on OSX

查看:198
本文介绍了OSX上的键盘输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能读取键盘输入,在OSX从什么地方,如GNU / Linux下的/ dev /输入文件。

I was wondering if it was possible to read the keyboards input, on OSx from somewhere, such as GNU/Linux with the /dev/input files.

这样做的目的是使一个很简单的键盘记录,(学习目的),或者如果有,我可以在C调用一个函数

The purpose of this is to make a very simple keylogger, (learning purpose), or if there is a function that i could call in C.

感谢。

推荐答案

由于并不是所有的读者有良好的意愿为你,我不会进入细节,但颇有点你正确的方向。

Since not all readers have good intentions as you, I won't get into details, but rather point you to the right direction.

正如你可能知道,WindowServer工作在两种环境:碳(旧)和可可(新)。这些是各自的API:

As you may know, the WindowServer works over two environments: Carbon (old) and Cocoa (new). These are the respective APIs:


  1. 碳→ InstallEventHandler (链路断开?由于年龄无论如何,参考书籍是学习碳,第6章 - 碳活动)

  2. 可可→<一个href=\"https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/index.html#//apple_ref/occ/clm/NSEvent/addGlobalMonitorForEventsMatchingMask:handler:\"相对=nofollow> addGlobalMonitorForEventsMatchingMask

  1. Carbon → InstallEventHandler (link is broken due to age? Anyway, the referenced book is Learning Carbon, Chapter 6 - Carbon Events)
  2. Cocoa → addGlobalMonitorForEventsMatchingMask

这篇关于OSX上的键盘输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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