/dev/input
/dev/input是所有输入设备的集合,/dev/input目录下包含每个输入设备的文件设备。
键值头文件:include/linux/input.h
uinput
Uinput是linux 2.6用来实现用户空间输入设备的内核接口,用它可以在用户空间实现输入设备,向系统中注入输入事件,而不需要通过GUI去实现。
参考:
inotify
int fd = inotify_init (); int wd = inotify_add_watch (fd, path, mask); int ret = inotify_rm_watch (fd, wd); struct inotify_event { __s32 wd; /* watch descriptor */ __u32 mask; /* watch mask */ __u32 cookie; /* cookie to synchronize two events */ __u32 len; /* length (including nulls) of name */ char name[0]; /* stub for possible name */ }; |