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)];
u
Ïà¹ØÎĵµ£º
ÎÞÂÛʲô±à³ÌÓïÑÔ¶¼Àë²»¿ªÌõ¼þÅжϡ£SHELLÒ²²»ÀýÍâ¡£
if list then
do something here
elif list then
do another thing here
......
±êÌ⣺Linux½ø³ÌͨÐÅ-ʹÓÃÐźÅÁ¿
Ò»¡¢Ïà¹Ø֪ʶ
ÐźÅÁ¿£ºÒ»¸öÕûÊý£»
´óÓÚ»òµÈÓÚ0ʱ´ú±í¿É¹©²¢·¢½ø³ÌʹÓõÄ×ÊԴʵÌåÊý£»
СÓÚ0ʱ´ú±íÕýÔڵȴýʹÓÃÁÙ½çÇøµÄ½ø³ÌÊý£»
ÓÃÓÚ»¥³âµÄÐźÅÁ¿³õʼֵӦ´óÓÚ0£»
Ö»ÄÜͨ¹ýP¡¢VÔÓï²Ù×÷¶ø¸Ä±ä£»
ÐźÅÁ¿ÔªËØ×é³É£º
1¡¢±íʾÐźÅÁ¿ÔªË ......
ÎÞÂÛ΢ÈíÈçºÎרעÓÚ×ÀÃ棬XµÄÉè¼Æ»¹ÊÇÄÜÈÃËûÃǺ¹ÑÕ¡£±È½ÏÒ»ÏÂWindowsÔ¶³Ì×ÀÃæ(2008ServerÖÕÓÚÓÐËù¸Ä½ø)ºÍXת·¢µÄЧ¹û¾Í¿ÉÒÔÀí½â£¬ÎªÊ²Ã´*nixµÄÊÀ½çÀïÏÔʾGUI»·¾³ÒÀ¿¿µÄ¾¹È»ÊÇServer-Client¼Ü¹¹¡£
ÔÚWindowsÏ£¬Ö»ÒªÊµÏÖÁ½¸öÒªËؾͿÉÒÔʵÏÖXµÄת·¢£º1.X Server·þÎñ£»2.ssh¿Í»§¶Ë¡£Ç°Õß¿ÉÒÔÓÃXming£¬ºóÕß¿ÉÒÔÓÃputty»òopenS ......
Linux ²Ù×÷ϵͳ´ÓÒ»¿ªÊ¼¾Í¶Ô´®ÐпÚÌṩÁ˺ܺõÄÖ§³Ö,±¾ÎÄ¾Í Linux ϵĴ®ÐпÚͨѶ±à³Ì½øÐмòµ¥µÄ½éÉÜ¡£
´®¿Ú¼ò½é
´®ÐпÚÊǼÆËã»úÒ»ÖÖ³£ÓõĽӿÚ,¾ßÓÐÁ¬½ÓÏßÉÙ,ͨѶ¼òµ¥,µÃµ½¹ã·ºµÄʹÓᣳ£ÓõĴ®¿ÚÊÇ RS-232-C ½Ó¿Ú£¨ÓÖ³Æ EIA RS-232-C£©ËüÊÇÔÚ 1970 ÄêÓÉÃÀ¹úµç×Ó¹¤ÒµÐ»á£¨EIA£©ÁªºÏ±´¶ûϵͳ¡¢ µ÷Öƽâµ÷Æ÷³§¼Ò¼°¼ÆËã»úÖÕ ......
µÚÒ»´ÎÔÚLinuxÉÏ°²×°OracleµÄʱºòÅöµ½Õâ¸öÎÊÌ⣬ºÇºÇ¡£Ö®Ç°ÔÚLinuxÉÏ°²×°Oracleʱ£¬Ò»°ã¶¼Ê¹ÓÃRedHatϵÁеÄLinux£¬ÔÚ°²×°¹ý³ÌÖУ¬ÐèÒª×ö´óÁ¿µÄ°²×°Ç°Öù¤×÷£¬Èç°²×°RPM°ü£¬´´½¨×éºÍÓû§£¬ÐÞ¸ÄÄں˲ÎÊý£¬Ð޸Ļ·¾³±äÁ¿µÈ¡£Õâ´ÎʹÓõÄÊÇRedFlagµÄAsianux 3£¬¶øÇÒ×Ô´øOracleµÄ°²×°¸¨Öú¹¤¾ßOrana ......