Linux input.h(我将在.NET 中链接到哪个库)
我正在使用 Mono C#,想知道“input.h”依赖于哪个物理库? 我搜索过谷歌但没有得到任何结果。
注意更新:这里的目标是在 Linux 中获得键盘和鼠标输入。所以问题是我需要包装什么库来输入。有没有使用“input.h”获取输入的好的 C/C++ 示例?
在 C# 中,要链接到库,您需要执行以下操作::
[DllImport("libX11", EntryPoint = "XOpenDisplay")]
public static extern IntPtr XOpenDisplay(IntPtr display_name);
所以我需要执行与上面相同的操作,但使用输入库。像这样的东西::
[DllImport("libInput ???", EntryPoint = "CreateDevice")]
public static extern IntPtr CreateDevice(int deviceID, ...);
我打算使用这个 键盘输入链接即可开始...
I'm using Mono C# and would like to know what physical library "input.h" is dependent on?
Ive searched google but am not getting anything.
NOTE UPDATE: The goal here is to get Keyboard and Mouse input in Linux. So rly the question is what library do I need to wrap for input. Are there any good C/C++ examples for getting input using "input.h"?
In C# to link to a library you would do something like::
[DllImport("libX11", EntryPoint = "XOpenDisplay")]
public static extern IntPtr XOpenDisplay(IntPtr display_name);
So I need to do the same thing as above but with the input library. Something like::
[DllImport("libInput ???", EntryPoint = "CreateDevice")]
public static extern IntPtr CreateDevice(int deviceID, ...);
I was going to use this Keyboard Input link to get started after I find what library to link to...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我想出了如何通过 X11 获取所有按键和鼠标输入。我正在 OSX 上的 Cocoa 中做一些非常类似的事情。
因此,对于任何想知道我是如何做到这一点的基础知识的人,如果您发现 X11 事件逻辑有任何问题,请告诉我::
Ok so I figured out how to get all the key and mouse input through X11. I'm doing something very similar in Cocoa on OSX.
So for anyone wondering the basics of how I did it, Here ya go and let me know if you see anything wrong with the X11 event logic::
linux/input.h
只是一堆常量和结构体;它背后没有库,因为您应该自己打开/访问事件子系统。linux/input.h
is just a bunch of constants and structs; there is no library behind it since you're supposed to open/access the event subsystem yourself.