亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? event.svga

?? UBOOT 源碼
?? SVGA
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************           The SuperVGA Kit - UniVBE Software Development Kit**  ========================================================================**    The contents of this file are subject to the SciTech MGL Public*    License Version 1.0 (the "License"); you may not use this file*    except in compliance with the License. You may obtain a copy of*    the License at http://www.scitechsoft.com/mgl-license.txt**    Software distributed under the License is distributed on an*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or*    implied. See the License for the specific language governing*    rights and limitations under the License.**    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.**    The Initial Developer of the Original Code is SciTech Software, Inc.*    All Rights Reserved.**  ========================================================================** Language:     ANSI C* Environment:  IBM PC (MS DOS)** Description:  Routines to provide a Linux event queue, which automatically*               handles keyboard and mouse events for the Linux compatability*               libraries. Based on the event handling code in the MGL.*****************************************************************************/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <ctype.h>#include <termios.h>#include <signal.h>#include <fcntl.h>#include <unistd.h>#include <errno.h>#include <sys/time.h>#include <sys/stat.h>#include <sys/types.h>#include <linux/keyboard.h>#include <linux/kd.h>#include <linux/vt.h>#include <gpm.h>#include "pm.h"#include "vesavbe.h"#include "wdirect.h"/*--------------------------- Global variables ----------------------------*/#define EVENTQSIZE  100             /* Number of events in event queue  */static int      head = -1;          /* Head of event queue              */static int      tail = -1;          /* Tail of event queue              */static int      freeHead = -1;      /* Head of free list                */static int      count = 0;          /* No. of items currently in queue  */static WD_event evtq[EVENTQSIZE];   /* The queue structure itself      */static int      oldMove = -1;       /* Previous movement event          */static int      oldKey = -1;        /* Previous key repeat event        */static int      mx,my;              /* Current mouse position           */static int      xRes,yRes;          /* Screen resolution coordinates    */static void     *stateBuf;          /* Pointer to console state buffer  */static int      conn;               /* GPM file descriptor for mouse handling */static int      tty_fd;             /* File descriptor for /dev/console */extern int      tty_vc;             /* Virtual console ID, from the PM/Pro library */static ibool    key_down[128];      /* State of all keyboard keys       */static struct termios old_conf;     /* Saved terminal configuration     */static int      oldkbmode;          /* and previous keyboard mode       */struct vt_mode  oldvtmode;          /* Old virtual terminal mode        */static int      old_flags;          /* Old flags for fcntl              */static ulong    key_modifiers;      /* Keyboard modifiers               */static int      forbid_vt_release=0;/* Flag to forbid release of VT     */static int      forbid_vt_acquire=0;/* Flag to forbid cature of VT      */static int      oldmode;            /* Old SVGA mode saved for VT switch*/static int      initmode;           /* Initial text mode                */static ibool    installed = false;  /* True if we are installed         */static void     (_ASMAPI *moveCursor)(int x,int y) = NULL;static int      (_ASMAPI *suspendAppCallback)(int flags) = NULL;#if 0/* Keyboard Translation table from scancodes to ASCII */static uchar keyTable[128] ="\0\0331234567890-=\010""\011qwertyuiop[]\015""\0asdfghjkl;'`\0\\""zxcvbnm,./\0*\0 \0""\0\0\0\0\0\0\0\0\0\0\0\0"      /* Function keys */"789-456+1230.\0\0\0\0\0"       /* Keypad keys */"\0\0\0\0\0\0\0\015\0/";static uchar keyTableShifted[128] ="\0\033!@#$%^&*()_+\010""\011QWERTYUIOP{}\015""\0ASDFGHJKL:\"~\0|""ZXCVBNM<>?\0*\0 \0""\0\0\0\0\0\0\0\0\0\0\0\0"      /* Function keys */"789-456+1230.\0\0\0\0\0"       /* Keypad keys */"\0\0\0\0\0\0\0\015\0/";#endif/* Macros to keep track of the CAPS and NUM lock states */#define EVT_CAPSSTATE   0x0100#define EVT_NUMSTATE    0x0200/* Helper macros for dealing with timers */#define TICKS_TO_USEC(t) ((t)*65536.0/1.193180)#define USEC_TO_TICKS(u) ((u)*1.193180/65536.0)/* Number of keycodes to read at a time from the console */#define KBDREADBUFFERSIZE 32/*---------------------------- Implementation -----------------------------*//****************************************************************************REMARKS:Returns the current time stamp in units of 18.2 ticks per second.****************************************************************************/static ulong getTimeStamp(void){    return (ulong)(clock() / (CLOCKS_PER_SEC / 18.2));}/****************************************************************************PARAMETERS:evt - Event to place onto event queueREMARKS:Adds an event to the event queue by tacking it onto the tail of the eventqueue. This routine assumes that at least one spot is available on thefreeList for the event to be inserted.****************************************************************************/static void addEvent(    WD_event *evt){    int         evtID;    /* Get spot to place the event from the free list */    evtID = freeHead;    freeHead = evtq[freeHead].next;    /* Add to the tail of the event queue   */    evt->next = -1;    evt->prev = tail;    if (tail != -1)        evtq[tail].next = evtID;    else        head = evtID;    tail = evtID;    evtq[evtID] = *evt;    count++;}/****************************************************************************PARAMETERS:what        - Event codemessage     - Event messagemodifiers   - keyboard modifiersx           - Mouse X position at time of eventy           - Mouse Y position at time of eventbut_stat    - Mouse button status at time of eventREMARKS:Adds a new mouse event to the event queue. This routine is called fromwithin the mouse interrupt subroutine, so it must be efficient.****************************************************************************/static void addMouseEvent(    uint what,    uint message,    int x,    int y,    uint but_stat){    WD_event    evt;    if (count < EVENTQSIZE) {        evt.what = what;        evt.when = getTimeStamp();        evt.message = message;        evt.modifiers = but_stat | key_modifiers;        evt.where_x = x;        evt.where_y = y;        fprintf(stderr, "(%d,%d), buttons %ld\n", x,y, evt.modifiers);        addEvent(&evt);                 /* Add to tail of event queue   */        }}/****************************************************************************PARAMETERS:scancode    - Raw keyboard scan codemodifiers   - Keyboard modifiers flagsREMARKS:Converts the raw scan code into the appropriate ASCII code using the scancode and the keyboard modifier flags.****************************************************************************/static ulong getKeyMessage(    uint scancode,    ulong modifiers){    ushort  code = scancode << 8;    ushort  ascii;    struct kbentry ke;    ke.kb_index = scancode;    /* Find the basic ASCII code for the scan code */    if (modifiers & EVT_CAPSSTATE) {        if (modifiers & EVT_SHIFTKEY)          ke.kb_table = K_NORMTAB;        //          ascii = tolower(keyTableShifted[scancode]);        else          ke.kb_table = K_SHIFTTAB;        //          ascii = toupper(keyTable[scancode]);        }    else {        if (modifiers & EVT_SHIFTKEY)          ke.kb_table = K_SHIFTTAB;          // ascii = keyTableShifted[scancode];        else          ke.kb_table = K_NORMTAB;          // ascii = keyTable[scancode];        }    if(modifiers & EVT_ALTSTATE)      ke.kb_table |= K_ALTTAB;    if (ioctl(tty_fd, KDGKBENT, (unsigned long)&ke)) {        fprintf(stderr, "KDGKBENT at index %d in table %d: ",            scancode, ke.kb_table);        return 0;    }    ascii = ke.kb_value;    /* Add ASCII code if key is not alt'ed or ctrl'ed */    if (!(modifiers & (EVT_ALTSTATE | EVT_CTRLSTATE)))        code |= ascii;    return code;}/****************************************************************************PARAMETERS:what        - Event codescancode    - Raw scancode of keyboard event to addREMARKS:Adds a new keyboard event to the event queue. We only take KEYUP andKEYDOWN event codes, however if a key is already down we convert the KEYDOWNto a KEYREPEAT.****************************************************************************/static void addKeyEvent(    uint what,    uint scancode){    WD_event    evt;    if (count < EVENTQSIZE) {        evt.what = what;        evt.when = getTimeStamp();        evt.message = getKeyMessage(scancode,key_modifiers) | 0x10000UL;        evt.where_x = evt.where_y = 0;        evt.modifiers = key_modifiers;        if (evt.what == EVT_KEYUP)            key_down[scancode] = false;        else if (evt.what == EVT_KEYDOWN) {            if (key_down[scancode]) {                if (oldKey != -1) {                    evtq[oldKey].message += 0x10000UL;                    }                else {                    evt.what = EVT_KEYREPEAT;                    oldKey = freeHead;                    addEvent(&evt);                    oldMove = -1;                    }                return;                }            key_down[scancode] = true;            }        addEvent(&evt);        oldMove = -1;        }}/****************************************************************************PARAMETERS:sig - Signal being sent to this signal handlerREMARKS:Signal handler for the timer. This routine takes care of periodicallyposting timer events to the event queue.****************************************************************************/void timerHandler(    int sig){    WD_event    evt;    if (sig == SIGALRM) {        if (count < EVENTQSIZE) {            evt.when = getTimeStamp();            evt.what = EVT_TIMERTICK;            evt.message = 0;            evt.where_x = evt.where_y = 0;            evt.modifiers = 0;            addEvent(&evt);            oldMove = -1;            oldKey = -1;            }        signal(SIGALRM, timerHandler);        }}/****************************************************************************REMARKS:Restore the terminal to normal operation on exit****************************************************************************/static void restore_term(void){    RMREGS  regs;    if (installed) {        /* Restore text mode and the state of the console */        regs.x.ax = 0x3;        PM_int86(0x10,&regs,&regs);        PM_restoreConsoleState(stateBuf,tty_fd);        /* Restore console to normal operation */        ioctl(tty_fd, VT_SETMODE, &oldvtmode);        ioctl(tty_fd, KDSKBMODE, oldkbmode);        tcsetattr(tty_fd, TCSAFLUSH, &old_conf);        fcntl(tty_fd,F_SETFL,old_flags &= ~O_NONBLOCK);        PM_closeConsole(tty_fd);        /* Close the mouse driver */        close(conn);        /* Flag that we are not no longer installed */        installed = false;        }}/****************************************************************************REMARKS:Signal handler to capture forced program termination conditions so that

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91色porny| 99久久精品99国产精品| 欧美三级日韩三级| 国产suv精品一区二区三区| 久久99国产精品麻豆| 日本一区中文字幕| 日韩和欧美的一区| 欧美96一区二区免费视频| 日韩精品一二三区| 蜜芽一区二区三区| 裸体歌舞表演一区二区| 精品一区二区三区不卡| 国产一区二区在线看| 国产不卡高清在线观看视频| 亚洲欧洲中文日韩久久av乱码| 在线视频一区二区三区| 在线电影院国产精品| 日韩欧美一区中文| 国产欧美一区二区在线| 国产精品福利一区| 午夜精品福利久久久| 久久精品噜噜噜成人av农村| 成人午夜免费电影| 欧美伊人久久久久久久久影院| 日本午夜一区二区| 中文字幕视频一区二区三区久| 欧美精品一卡二卡| 色哟哟在线观看一区二区三区| 蜜臀av性久久久久蜜臀av麻豆 | 欧洲日韩一区二区三区| 欧美男男青年gay1069videost| 成人黄动漫网站免费app| 91免费国产在线| 欧美一区二区三区在线电影| 在线观看一区二区视频| 欧美电影免费观看高清完整版在| 欧美日韩一区国产| 久久久久国产精品免费免费搜索| 日韩视频免费直播| 综合色中文字幕| 老司机精品视频线观看86| 99久久久国产精品免费蜜臀| 日韩一级大片在线观看| 亚洲另类中文字| 国产福利电影一区二区三区| 91亚洲国产成人精品一区二区三| 久久精品免费看| 精品一区二区日韩| 一本大道久久a久久综合| 国产精品一二三区在线| 一本色道久久综合亚洲91| 欧美日韩一区二区三区高清| av一区二区不卡| 欧美午夜理伦三级在线观看| 精品粉嫩aⅴ一区二区三区四区| 欧美日韩色一区| 欧美不卡一二三| 夜色激情一区二区| 国产在线不卡一卡二卡三卡四卡| 美女在线一区二区| 色一情一乱一乱一91av| bt7086福利一区国产| 欧美精品一级二级三级| 中文字幕一区二区三| 欧美一区二区三区四区五区| 久久久99免费| 亚洲一区二区三区精品在线| 日韩一区精品视频| 亚洲网友自拍偷拍| 秋霞影院一区二区| 91高清视频免费看| 成人免费小视频| 一区av在线播放| 中文字幕在线不卡国产视频| 视频一区视频二区中文字幕| 成人av在线资源| 久久精品水蜜桃av综合天堂| 日韩国产欧美在线观看| 在线日韩av片| 久久色视频免费观看| 国产精品一二三区在线| 日韩美女天天操| 午夜成人免费电影| 欧美伊人精品成人久久综合97| 欧美日韩国产欧美日美国产精品| 欧美日韩在线播放三区| 一区二区久久久久久| 色欧美88888久久久久久影院| 欧美在线一区二区三区| 国产精品国产三级国产a| 成人一区二区三区在线观看| 国产亚洲精品中文字幕| 黄色成人免费在线| 久久久久国产免费免费| 国产在线看一区| 亚洲天堂精品视频| 日本精品视频一区二区| 亚洲成在人线免费| 欧美日韩高清一区二区三区| 亚洲国产综合人成综合网站| 国产一区二区三区精品视频| av中文字幕在线不卡| 亚洲欧美综合色| 蜜桃av一区二区| 日韩欧美国产一区二区在线播放| 中文成人综合网| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 亚洲欧美精品午睡沙发| 91蜜桃在线观看| 亚洲影视在线观看| 蜜桃精品视频在线| 91丨porny丨国产| 亚洲一区二区三区不卡国产欧美| 国内成人免费视频| 在线日韩国产精品| 人禽交欧美网站| 久久综合资源网| 一本一道波多野结衣一区二区| 日韩午夜激情免费电影| 国产精品中文字幕日韩精品| 91在线国产观看| 午夜精品视频一区| 91亚洲精品久久久蜜桃网站| 亚洲丰满少妇videoshd| 久久免费美女视频| 91国产成人在线| 激情综合一区二区三区| 中文字幕在线不卡国产视频| 欧美日韩成人综合天天影院| 国产精品亚洲午夜一区二区三区| 3751色影院一区二区三区| 狠狠狠色丁香婷婷综合激情| 欧美精品乱码久久久久久按摩| 亚洲欧美综合另类在线卡通| 91色在线porny| 久久久亚洲高清| 91网站最新网址| 激情偷乱视频一区二区三区| 中文字幕中文在线不卡住| 欧美一区二区视频观看视频| 97久久超碰国产精品| 久久久亚洲国产美女国产盗摄| 亚洲主播在线播放| 中文字幕成人在线观看| 91精品国产aⅴ一区二区| 97精品久久久久中文字幕 | 国产精品 欧美精品| 天堂一区二区在线免费观看| 欧美三级韩国三级日本一级| 国产一区在线精品| 久久久青草青青国产亚洲免观| 另类综合日韩欧美亚洲| 亚洲午夜在线观看视频在线| 国产精品护士白丝一区av| 成人精品小蝌蚪| 狠狠色综合日日| 午夜激情久久久| 欧美国产欧美综合| 国产精品久久久久久久久图文区 | 国产精品一卡二| 亚洲综合在线视频| 午夜伦理一区二区| 曰韩精品一区二区| 国产精品美日韩| 国产日产欧美一区二区三区| 欧美色老头old∨ideo| 国产在线一区二区综合免费视频| 国产欧美综合在线| 久久亚洲捆绑美女| 白白色亚洲国产精品| 国产99久久久国产精品潘金| 国产一二三精品| 亚洲午夜免费电影| 韩国女主播一区二区三区| 久久99蜜桃精品| 国产综合久久久久久鬼色 | 男人的天堂久久精品| 久久久久久久精| 欧美色图在线观看| 成人av高清在线| 一本色道久久综合精品竹菊| 91久久精品一区二区| 激情深爱一区二区| 国产一区视频在线看| 国产 日韩 欧美大片| 99久久精品免费精品国产| 99国产精品99久久久久久| 亚洲欧洲制服丝袜| 亚洲天堂中文字幕| 一区二区国产盗摄色噜噜| 香蕉乱码成人久久天堂爱免费| 久久久久国产一区二区三区四区| av不卡在线观看| 一本一道久久a久久精品| 欧美优质美女网站| 国产成人av电影| 色女孩综合影院| 精品三级在线观看| 亚洲欧美激情视频在线观看一区二区三区 | 亚洲免费观看高清完整版在线观看熊|