LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1156|回复: 14

How to disable keyboard and mouse temparily

[复制链接]
发表于 2004-1-13 07:32:08 | 显示全部楼层 |阅读模式
When I use X extension to simulate X event to applications, I want to disable keyboard and mouse temparily in order to avoid the user interception.

Is there a way to do that?

Thanks in advance.

Any help is appreciated.
发表于 2004-1-13 20:19:45 | 显示全部楼层
Simple:
Unplug your keyboard & mouse temparily:p
发表于 2004-1-13 20:28:11 | 显示全部楼层
如果xwindow是事件驱动的吧,可以忽略掉相应的事件。
如果不是,。。。
 楼主| 发表于 2004-1-14 04:43:41 | 显示全部楼层
不是那么简单。关键是如何让其他应用程序忽略用户的输入。有点像windows下面的hook.但是在Xwindow下面如何做这个hook?
 楼主| 发表于 2004-1-14 05:00:50 | 显示全部楼层
忘了谢谢各位了,我希望有更多的人能够参与讨论。
发表于 2004-1-14 17:07:19 | 显示全部楼层
可以先了解一下xwindow的事件驱动机制。
http://www.kerguelen.org/x/tutorial-8.html
其实直接用xlib编程是很麻烦的,一般都是用图形库开发比较方便。可以去看看QT或GTK是如何处理事件的。
发表于 2004-1-14 22:44:39 | 显示全部楼层
我在图书馆借了一本linux OpenGL编程,看不太懂!

X-win的编程用kylix我觉得还可以。
 楼主| 发表于 2004-1-15 06:45:53 | 显示全部楼层
Is there a system call which can disable the keyboard device?
发表于 2004-1-15 17:25:49 | 显示全部楼层
xwindow是在用户态实现的,不需要进行系统调用。
还是多了解一下xlib的使用。
 楼主| 发表于 2004-1-16 03:41:30 | 显示全部楼层
Hi kj501,

Thank you for your reply.

I have done research on it for a long time. I don't think there's a xlib function could intercept the X events like the hook in Windows. Do you have any suggestion on it?

I have tried other extension library such as X Record.  However, I can only get a copy of the events but intercept them. I am thinking about X Trap extension library. If anybody here has exprience on it, please reply or send email to me.

I also wonder if there's a system call could disable keyboard such as a device driver. If I can disable the keyboard at the level. X server won't generate X keyboard events. It is also a workaround for my current project.

Thank you.

--------------------
I cannot figure out how to input Chinese in English UI on Gentoo.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表