In this paper, a simple example of the C program to read keyboard code method, share for everyone to reference. The specific analysis is as follows:
In general, keyboard code in the bottom of the development is often used, sometimes we will forget them, we must hurry to find key-code table view, in fact, the program can print out their own key-code corresponding to the value
Specific examples are as follows:
#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;
}
The more detailed keyboard code and keyboard keys are listed below for your reference:
Keyboard Code key
Functional area
0X011B ESC
0x3b00 F1
0X3C00 F2
0x3d00 F3
0x3e00 F4
0X3F00 F5
0x4000 F6
0x4100 F7
0x4200 F8
0x4300 F9
0x4400 F10
Main keyboard Area:
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 backspace key
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 Carriage return
0X2C7A Z
0x2d78 x
0x2e63 C
0x2f76 V
0x3062 b
0x316e N
0x326d m
0X332C,
0x342e.
0X352F/
0x3920 Space Key
Right digit keyboard:
0x5200 Insert
0x4700 Home
0x4900 Page up
0x5300 Delete
0X4F00 End
0x5100 PageDown
0x4800 Up ARROW
0x4b00 LEFT Arrow
0x5000 DOWN ARROW
0x4d00 RIGHT Arrow
0X352F/
0X372A *
0X4A2D-(Note that this is the numeric keypad)
0x4737 7
0x4838 8
0x4939 9
0x4b34 4
0X4C35 5
0X4D36 6
0x4e2b +
0X4F31 1
0x5032 2
0x5133 3
0x5230 0
0x532e Del