⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ir_osi_acer_kbms.c

📁 IBM source for pallas/vulcan/vesta
💻 C
📖 第 1 页 / 共 2 页
字号:
                PDEBUG("R%d", down);        break;            case 0x3b:     // alt        if (down)            shift_down |= ir_lalt_down;        else            shift_down &= ~ir_lalt_down;                PDEBUG("A%d", down);        break;            case 0x73:     // ctl        if (down)            shift_down |= ir_lctl_down;        else            shift_down &= ~ir_lctl_down;                PDEBUG("C%d", down);        break;            case 0x5F:     // mouse left button        if (down)            shift_down |= ir_lbtn_down;        else            shift_down &= ~ir_lbtn_down;                PDEBUG("BL%d", down);        break;            case 0x1F:     // mouse right button        if (down)            shift_down |= ir_rbtn_down;        else            shift_down &= ~ir_rbtn_down;                PDEBUG("BR%d", down);        break;#ifdef _IR_KEYBOARD_AUTO_KEY_UP    default:   // other keys        _is_shift = 0;#endif    }        // check to see if shift status is changed    /* uCode = 00 <r><m><l> shift(1) alt(1) ctrl(1) , key(7) up/down(1) */    shift_status = (USHORT) (uCode >> 8);    // get current shift status with this key    shift_changes = shift_status ^ old_shift_status;  // and the changes    if (shift_changes)    {        // shift changed, check if we should patch it        PDEBUG("%d %d \n", old_shift_status, shift_status);        if ((shift_changes) & _ir_sft_sft)   // shift        {            if (shift_status & _ir_sft_sft)    // check if we need to send shift down            {                // check if we have some record of shift down                if (!(shift_down & (ir_lsft_down | ir_rsft_down)))                {                    // we need to regenerate it                    PDEBUG("L1");                    // assume only left shift down is missing                    if (keycode_handler) keycode_handler(0x2A, 1);                    // or we can also send right shift up if it                     // will not break keyboard routines in kernel                    // if (keycode_handler) keycode_handler(0x36, 1);                    shift_down |= ir_lsft_down;                    cnt ++;                }            }            else        // check if we should send shift up            {                if (shift_down & ir_lsft_down)  // we need to send it                {                    PDEBUG("L0");                    // left shift up missing                    if (keycode_handler) keycode_handler(0x2A | 0x80, 0);                    shift_down &= ~ir_lsft_down;                    cnt ++;                }                                if (shift_down & ir_rsft_down)  // we need to send it                {                    PDEBUG("R0");                    // right shift up missing                    if (keycode_handler) keycode_handler(0x36 | 0x80, 0);                    shift_down &= ~ir_rsft_down;                    cnt ++;                }            }        }                if ((shift_changes) & _ir_sft_alt)   // check for alt status         {            if (shift_status & _ir_sft_alt)    // check if we need to send alt down            {                if (!(shift_down & (ir_lalt_down)))     // we need to send it                {       // assume is left alt down missing                    if (keycode_handler) keycode_handler(0x38, 1);                    shift_down |= ir_lalt_down;                    cnt ++;                }            }            else        // check if we should send alt up            {                if (shift_down & ir_lalt_down)  // we need to send it                {       // left alt up missing                    if (keycode_handler) keycode_handler(0x38 | 0x80, 0);                    shift_down &= ~ir_lalt_down;                    cnt ++;                }            }        }                if ((shift_changes) & _ir_sft_ctl)   // check for ctl status        {            if (shift_status & _ir_sft_ctl)    // check if we need to send ctl down            {                if (!(shift_down & (ir_lctl_down)))     // we need to send it                {       // assume is left ctl down missing                    if (keycode_handler) keycode_handler(0x1D, 1);                    shift_down |= ir_lctl_down;                    cnt ++;                }            }            else        // check if we should send ctl up            {                if (shift_down & ir_lctl_down)  // we need to send it                {       // left ctl up missing                    if (keycode_handler) keycode_handler(0x1D | 0x80, 0);                    shift_down &= ~ir_lctl_down;                    cnt ++;                }            }        }                if ((shift_changes) & _ir_sft_rbtn)   // check for right button status        {            if (shift_status & _ir_sft_rbtn)    // check if we need to send rbutton down            {                if (!(shift_down & (ir_rbtn_down)))     // we need to send it                {                       // assume is rbutton down missing                    if (mouse_handler) mouse_handler(0,0, __IR_MOUSE_RBUTTON_DOWN);                    shift_down |= ir_rbtn_down;                    cnt ++;                }            }            else        // check if we should send rbutton up            {                if (shift_down & ir_rbtn_down)  // we need to send it                {                    // right button up missing                    if (mouse_handler) mouse_handler(0,0, __IR_MOUSE_RBUTTON_UP);                    shift_down &= ~ir_rbtn_down;                    cnt ++;                }            }        }                if ((shift_changes) & _ir_sft_lbtn)   // check for left button status        {            if (shift_status & _ir_sft_lbtn)    // check if we need to send lbutton down            {                if (!(shift_down & (ir_lbtn_down)))     // we need to send it                {                    // assume is lbutton down missing                    if (mouse_handler) mouse_handler(0,0, __IR_MOUSE_LBUTTON_DOWN);                    shift_down |= ir_lbtn_down;                    cnt ++;                }            }            else        // check if we should send lbutton up            {                if (shift_down & ir_lbtn_down)  // we need to send it                {                           // left button up missing                    if (mouse_handler) mouse_handler(0,0, __IR_MOUSE_LBUTTON_UP);                    shift_down &= ~ir_lbtn_down;                    cnt ++;                }            }        }    }        old_shift_status = shift_status;    // ok, remenber current status    // ###        switch (key >> 1)    {    case 0x5F:     // mouse left button        PDEBUG("%x %x \n", key, shift_status);        if (mouse_handler) mouse_handler(0,0, down ? __IR_MOUSE_LBUTTON_DOWN : __IR_MOUSE_LBUTTON_UP);        cnt ++;        break;            case 0x1F:     // mouse right button        PDEBUG("%x %x ", key, shift_status);        if (mouse_handler) mouse_handler(0,0, down ? __IR_MOUSE_RBUTTON_DOWN : __IR_MOUSE_RBUTTON_UP);        cnt ++;        break;            case 0x55:     /* pause */        if (keycode_handler) keycode_handler(0xe1, 0);        if (keycode_handler) keycode_handler(down ? 0x1d : 0x9d, down);        if (keycode_handler) keycode_handler(down ? 0x45 : 0xc5, down);        cnt +=3;        break;            case 0x65:     /* print screen */        if (keycode_handler) keycode_handler(0xe0, 0);        cnt++;        if (down)        {            if (keycode_handler) keycode_handler(0x2a, 1);            cnt++;        }        else        {            if (keycode_handler) keycode_handler(0x37, 0);            if (keycode_handler) keycode_handler(0x46, 0);            cnt+=2;        }        break;            default:        PDEBUG("%x %x \n", key, shift_status);        scan_code = acer_irkb_scan_code[key >> 1];                if (scan_code != 0xFFFF)        {            if (down)             {                if (scan_code & 0xFF00) /* 0xe0 */                {                    if (keycode_handler) keycode_handler((scan_code & 0xFF00) >> 8, 1);                    cnt++;                }                if (keycode_handler) keycode_handler(scan_code & 0xFF, 1);       /* down */                cnt++;#ifdef _IR_KEYBOARD_AUTO_KEY_UP                if (!_is_shift)                 {                    if (scan_code & 0xFF00) /* 0xe0 */                    {                        if (keycode_handler) keycode_handler((scan_code & 0xFF00) >> 8, 1);                        cnt++;                    }                    if (keycode_handler) keycode_handler((scan_code & 0xFF) | 0x80, 0); // up                    cnt++;                }  #endif            }                else             {#ifdef _IR_KEYBOARD_AUTO_KEY_UP                if (_is_shift) // shift up                {                    if (scan_code & 0xFF00) /* 0xe0 */                    {                        if (keycode_handler) keycode_handler((scan_code & 0xFF00) >> 8, 1);                        cnt++;                    }                    if (keycode_handler) keycode_handler((scan_code & 0xFF) | 0x80, 0); // or the up code should be already sent                       cnt++;                }#else                if (scan_code & 0xFF00) /* 0xe0 */                {                    if (keycode_handler) keycode_handler((scan_code & 0xFF00) >> 8, 1);                    cnt++;                }                if (keycode_handler) keycode_handler((scan_code & 0xFF) | 0x80, 0);      /* up */                cnt++;#endif            }        }    /* if (scan_code != 0xffff) */    }        /* switch */    return cnt; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -