易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux的Input Device

      Linux 的 Input Device 是重要的一個 subsystem,在進行實例介紹前,先大略了解一下相關的 API。input.c是Linux的输入驅動程式,主要支援鍵盤與滑鼠的輸入;input.c介面特殊的地方是採用了事件(event)的方式來處理輸入,以下是input.c介面重要的資料結構與函數:
* struct input_dev
* void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
* void input_register_device(struct input_dev *);
* void input_unregister_device(struct input_dev *);
* void input_register_handler(struct input_handler *);
* void input_unregister_handler(struct input_handler *);
(1) struct input_dev是用來描述輸入事件的重要資料結構,其原型如下:
struct input_dev {
 const char *name;
 const char *phys;
 const char *uniq;
 struct input_id id;
 unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
 unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
 unsigned long relbit[BITS_TO_LONGS(REL_CNT)];
 unsigned long absbit[BITS_TO_LONGS(ABS_CNT)];
 unsigned long mscbit[BITS_TO_LONGS(MSC_CNT)];
 unsigned long ledbit[BITS_TO_LONGS(LED_CNT)];
 unsigned long sndbit[BITS_TO_LONGS(SND_CNT)];
 unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];
 unsigned long swbit[BITS_TO_LONGS(SW_CNT)];
 unsigned int keycodemax;
 unsigned int keycodesize;
 void *keycode;
 int (*setkeycode)(struct input_dev *dev, int scancode, int keycode);
 int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode);
 struct ff_device *ff;
 unsigned int repeat_key;
 struct timer_list timer;
 int sync;
 int abs[ABS_MAX + 1];
 int rep[REP_MAX + 1];
 unsigned long key[BITS_TO_LONGS(KEY_CNT)];
 unsigned long led[BITS_TO_LONGS(LED_CNT)];
 unsigned long snd[BITS_TO_LONGS(SND_CNT)];
 unsign


相关文档:

Linux字符集 以及 网络通信监听

查看当前配置字符集 locale 
查看全部字符集 locale -a
设置字符集 export LANG=zh_CN.gbk
easy
tcpdump 一个linux监听网络访问的工具
监听服务器及端口
tcpdump -nn -i eth0 src host www.codigg.com and src port 80
正在使用的sql
tcpdump -s 0 -l -w - dst port 3306 | strings ......

linux kernel: HZ, tick and jiffies

http://linux.chinaunix.net/bbs/archiver/tid-985372.html
Linux Kernel: 简介HZ, tick and jiffie
               
Linux[/b]核心幾個重要跟時間有關的名詞或變數,底下將介紹HZ[/b]、tick與jiffies。
......

linux 常用命令整理

tar 文件与目录压缩命令
tar [-cxtzjvfpPN] 文件与目录 ....
参数:
-c :建立一个压缩文件的参数指令(create 的意思);
-x :解开一个压缩文件的参数指令!
-t :查看 tarfile 里面的文件!
特别注意,在参数的下达中, c/x/t 仅能存在一个!不可同时存在!因为不可能同时压缩与解压缩。
-z :是否同时具有 gzip 的 ......

Linux系统调用 sigaction函数详解(一)

功能描述: 
处理信号。既可用于设定对任意信号的处理方式,也可用于检验该信号的目前预设处置方式。
 
  
用法: 
#include <signal.h>
int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
       
 &n ......

understanding linux usb ehci device driver(2)

understanding linux usb ehci device driver(2)
understanding linux usb ehci device driver(2)
lm_tom@163.com
2. linux ehci device driver(ehci hcd)
2.1. linux usb subsystem arch overview(host)
2.2. ehci_hcd
2.3. ehci 实现的接口
2.3.1. ehci_pci_setup() (hc_driver->reset)
2.3.2. ehci_run() ( ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号