LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: laolu

How to disable keyboard and mouse temparily

[复制链接]
发表于 2004-1-16 16:53:16 | 显示全部楼层
 楼主| 发表于 2004-1-17 02:30:03 | 显示全部楼层
XEV uses XSelectInput to get events from a given resource. I uses X Record Extension to do that.

Grab can get the events which are sent to a window. However, the problem is that I also simulate events to that window at the same time. That means I cannot grab the keyboard or mouse events to my application since that window needs to process keyboard or mouse events.

mouse keyboard device
-------------------------------
X Server
-------------------------------
app         |       my client

In the figure, I want to simulate events to app. I can send events using X Test extension to app. But I don't want user input anything at that time. So, I think one way is disable the keyboard and mouse device. Another way is the keyboard and mouse events redirect to my client. However, in the second way, the events I simulated are also redirect to my client.

Thank you. I am very glad to discuss this topic with you.

--------------------
I cannot figure out how to input Chinese in English UI on Gentoo.
发表于 2004-1-18 16:31:06 | 显示全部楼层
如果说要同时处理鼠标和键盘事件,又要处理你的自定义事件,可以考虑把所有的事件都捕捉后,再分开来处理。
btw:我不熟悉xlib编程,这只是我的一个想法。
 楼主| 发表于 2004-1-21 06:51:37 | 显示全部楼层
It is a good way to do that. Actually I use this way (hook) on Windows platform. But i cannot find the way X Window platform.

It is why i ask for a system call to disable keyboard and mouse.

But I don't think linux or unix would allow an application without root permission to do that.
发表于 2004-1-28 19:01:25 | 显示全部楼层
图形界面的编程我也只是懂一点皮毛,没有办法和楼主更深入一步的交流了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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