跨平台键盘记录器 [英] Cross platform keylogger

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

问题描述

我正在寻找通过Python在Windows,Linux和Mac上观看鼠标和键盘事件的方法。

I'm looking for ways to watch mouse and keyboard events on Windows, Linux and Mac from Python.

我的应用程序是时间跟踪器。我不关注事件,只是记录事件发生的时间。如果在一定时间内(例如10分钟)没有事件,那么我认为用户已经离开并停止了当前项目。

My application is a time tracker. I'm not looking into the event, I just record the time when it happens. If there are no events for a certain time, say 10 minutes, I assume that the user has left and stop the current project.

当用户返回时(事件进入再次),我等了一会儿(所以这不会被清洁人员,您的宠物或地震触发)。如果事件持续较长时间,则假定用户已返回,并且弹出一个小的非活动窗口,她可以在其中选择将时间间隔添加到中断,当前项目(会议等)中,或者一个不同的项目。

When the user returns (events come in again), I wait a moment (so this doesn't get triggered by the cleaning crew or your pets or an earthquake). If the events persist over a longer period of time, I assume that the user has returned and I pop up a small, inactive window where she can choose to add the time interval to "break", the current project (meeting, etc) or a different project.

我已经使用 pyHook

在Linux上,我找到了一个解决方案,但我不喜欢它:我可以监视/ etc /中的所有设备节点。每次看到事件时,都在/ var或/ tmp中的某个地方输入并更新时间戳。有两个缺点:1.我无法判断事件是否来自运行时间跟踪器的用户,并且2.这个小程序需要以root用户身份运行(不好)。

On Linux, I have found a solution but I don't like it: I can watch all device nodes in /etc/input and update a timestamp somewhere in /var or /tmp every time I see an event. There are two drawbacks: 1. I can't tell whether the event if from the user who is running the time tracker and 2. this little program needs to be run as root (not good).

在Mac上,我还不知道。

On Mac, I have no idea, yet.

问题:


  1. 是否有比在Linux上观看事件设备更好的方法来了解用户是否正在创建事件?

  1. Is there a better way to know whether the user is creating events than watching the event devices on Linux?

任何指针


推荐答案

有几个开放的地方可能会为您提供一些指示的源应用程序:

There are couple of open source apps that might give you some pointers:

  • PyKeylogger is python keylogger for windows and linux
  • logKext is a c++ keylogger for mac

这篇关于跨平台键盘记录器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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