C中讀取鍵盤碼

來源:互聯網
上載者:User

標籤:style   blog   color   os   io   div   amp   log   

 

  鍵盤碼在底層開發中經常用到,有時候我們會忘記它們,就要急急忙忙的去找 鍵-碼 對照表查看,其實程式可以自己列印出 鍵-碼 對應值

#include <stdio.h> #include <bios.h> int main(void) {   int key, modifiers;   while ((key=bioskey(0)) != 0 && key!=0x11b){     printf("0x%x ",key);   }   return 0; } 

掃描碼        鍵 

功能區

0x011b        ESC 

0x3b00        F1 

0x3c00        F2 
0x3d00        F3 
0x3e00        F4 
0x3f00        F5 
0x4000        F6 
0x4100        F7 
0x4200        F8 
0x4300        F9 
0x4400        F10 

主鍵盤區: 
0x2960        ~ 
0x0231        1 
0x0332        2 
0x0433        3 
0x0534        4 
0x0635        5 
0x0736        6 
0x0837        7 
0x0938        8 
0x0a39        9 
0x0b30        0 
0x0c2d        - 
0x0d3d        = 
0x2b5c        \ 
0x0e08        退格鍵 
0x0f09        Tab 
0x1071        q 
0x1177        w 
0x1265        e 
0x1372        r 
0x1474        t 
0x1579        y 
0x1675        u 
0x1769        i 
0x186f        o 
0x1970        p 
0x1a5b        [ 
0x1b5d        ] 
0x1e61        a 
0x1f73        s 
0x2064        d 
0x2166        f 
0x2267        g 
0x2368        h 
0x246a        j 
0x256b        k 
0x266c        l 
0x273b        ; 
0x2827        ‘ 
0x1c0d        斷行符號 
0x2c7a        z 
0x2d78        x 
0x2e63        c 
0x2f76        v 
0x3062        b 
0x316e        n 
0x326d        m 
0x332c        , 
0x342e        . 
0x352f        / 
0x3920        空格鍵 


右邊數字鍵台: 
0x5200        Insert 
0x4700        Home 
0x4900        Page UP 
0x5300        Delete 
0x4f00        End 
0x5100        PageDown 
0x4800        上箭頭 
0x4b00        左箭頭 
0x5000        下箭頭 
0x4d00        右箭頭 
0x352f        / 
0x372a        * 
0x4a2d        - (注意,這是數字鍵台的) 
0x4737        7 
0x4838        8 
0x4939        9 
0x4b34        4 
0x4c35        5 
0x4d36        6 
0x4e2b        + 
0x4f31        1 
0x5032        2 
0x5133        3 
0x5230        0 
0x532e        Del 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.