PS/2 Keyboard: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
 
The keyboard reset transaction was not clear, the reset function does return ACK before the test result
 
(98 intermediate revisions by 46 users not shown)
Line 1:
== Overview ==
{{Convert}}
 
The PS/2 Keyboard is a device that talks to a PS/2 controller using [[PS/2|serial communication]]. Ideally, each different type of PS/2 controller driver should provide some sort of standard/simple "send byte/receive byte" interface, and the PS/2 Keyboard driver would use this interface without caring about lower level details (like what type of PS/2 controller the device is plugged into).
!! How to get keyboard input in protected mode
 
The PS/2 Keyboard accepts commands and sends responses to those commands, and also sends scan codes indicating when a key was pressed or released. Keep in mind that these scan codes (from the tables below) may be altered (i.e. translated) by the PS/2 controller, depending on the controller's settings.
First of all you should have this steps ready in your OS:
 
== Commands ==
* [Kernel loaded|BareBones]
* [IDT set up|InterruptsForDummies]
* [PIC remapped|Can I remap the PIC?]
* IRQ for keyboard unmasked and pointing to your future [keyboard ISR|InterruptServiceRoutines]
Read all about IRQ's and PIC's at HardWareIrq
 
A PS/2 Keyboard accepts many types of commands. A command is one byte. Some commands have data byte/s which must be sent after the command byte. The keyboard typically responds to a command by sending either an "ACK" (to acknowledge the command) or a "Resend" (to say something was wrong with the previous command) back. Don't forget to wait between the command, the data and the response from keyboard.
To get keyboard input you read the port 0x60 and save the translated scan code to a buffer.
 
The commands that a PS/2 Keyboard accepts are:
!! Okay, then what ?
 
{| {{wikitable}}
The keyboard communicates with your computer through a chip called 8042 (on modern system, the functionnality of that chip is emulated by the chipset). Any key press or key release leads to the transmission of a _scancode_ to the 8042 which then raises IRQ1 and makes the scancode available in its dataport (port 0x60).
|-
! Command Byte
! Data Byte/s
! Meaning
! Response
|-
| 0xED
| LED states:
{| {{wikitable}}
|-
! Bit
! Use
|-
| 0
| ScrollLock
|-
| 1
| NumberLock
|-
| 2
| CapsLock
|}
Note: Other bits may be used in international keyboards for other purposes (e.g. a Japanese keyboard might use bit 4 for a "Kana mode" LED).
| Set LEDs
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xEE
| None
| Echo (for diagnostic purposes, and useful for device removal detection)
| 0xEE (Echo) or 0xFE (Resend)
|-
| 0xF0
| Sub-command:
{| {{wikitable}}
|-
! Value
! Use
|-
| 0
| Get current scan code set
|-
| 1
| Set scan code set 1
|-
| 2
| Set scan code set 2
|-
| 3
| Set scan code set 3
|}
| Get/set current scan code set
| 0xFA (ACK) or 0xFE (Resend) if scan code is being set; 0xFA (ACK) then the scan code set number, or 0xFE (Resend) if you're getting the scancode. If getting the scancode the table indicates the value that identify each set:
{| {{wikitable}}
|-
! Value
! Use
|-
| 43
| Scan code set 1
|-
| 41
| Scan code set 2
|-
| 3f
| Scan code set 3
|}
 
|-
From your point of view, things are as easy as
| 0xF2
<verbatim>
| None
void KeyboardIsr()
| Identify keyboard
{
| 0xFA (ACK) followed by none or more ID bytes (see [["8042" PS/2 Controller#Detecting PS.2F2 Device Types|"Detecting Device Types"]])
byte new_scan_code = inportb(0x60);
|-
// do something with the scancode ...
| 0xF3
// remember you only get ONE byte of the scancode each time the ISR is invoked
| Typematic byte:
// (though most of the times the scancode is only one byte)
{| {{wikitable}}
|-
! Bit/s
! Meaning
|-
| 0 to 4
| Repeat rate (00000b = 30 Hz, ..., 11111b = 2 Hz)
|-
| 5 to 6
| Delay before keys repeat (00b = 250 ms, 01b = 500 ms, 10b = 750 ms, 11b = 1000 ms)
|-
| 7
| Must be zero
|}
| Set typematic rate and delay
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xF4
| None
| Enable scanning (keyboard will send scan codes)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xF5
| None
| Disable scanning (keyboard won't send scan codes)
Note: May also restore default parameters
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xF6
| None
| Set default parameters
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xF7
| None
| Set all keys to typematic/autorepeat only (scancode set 3 only)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xF8
| None
| Set all keys to make/release (scancode set 3 only)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xF9
| None
| Set all keys to make only (scancode set 3 only)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xFA
| None
| Set all keys to typematic/autorepeat/make/release (scancode set 3 only)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xFB
| Scancode for key
| Set specific key to typematic/autorepeat only (scancode set 3 only)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xFC
| Scancode for key
| Set specific key to make/release (scancode set 3 only)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xFD
| Scancode for key
| Set specific key to make only (scancode set 3 only)
| 0xFA (ACK) or 0xFE (Resend)
|-
| 0xFE
| None
| Resend last byte
| Previously sent byte or 0xFE (Resend)
|-
| 0xFF
| None
| Reset and start self-test
| 0xFA (ACK) or 0xFE (Resend) followed by 0xAA (self-test passed), 0xFC or 0xFD (self test failed)
|}
 
== Special Bytes ==
outportb(0x20,0x20); // acknowledge the IRQ, pretty much tells the PIC that we can accept >=priority IRQs now
}
</verbatim>
 
The keyboard sends bytes to the system. Some of these bytes have special meaning (e.g. responses from the commands above). The bytes the keyboard may send are:
See http://www.win.tue.nl/~~aeb/linux/kbd/scancodes.html for hints about how you should interprete what you get from the keyboard.
 
{| {{wikitable}}
Note that if you repeatedly read the port 0x60 without waiting for another IRQ, you'll read the same byte again. That's the 'normal' behaviour of keyboard controller, but if that doesn't suit your needs, you can still "acknowledge" the scancode by quickly disabling and re-enabling the keyboard at the PPI (Programmable Peripheral Interface):
|-
<verbatim>
! Response Byte
int temp = inportb(0x61);
! Meaning
outportb(0x61,temp | 0x80); // disable
|-
outportb(0x61,temp & 0x7F); // and reenable
| 0x00
</verbatim>
| Key detection error or internal buffer overrun
|-
| 0xAA
| Self test passed (sent after "0xFF (reset)" command or keyboard power up)
|-
| 0xEE
| Response to "0xEE (echo)" command
|-
| 0xFA
| Command acknowledged (ACK)
|-
| 0xFC and 0xFD
| Self test failed (sent after "0xFF (reset)" command or keyboard power up)
|-
| 0xFE
| Resend (keyboard wants controller to repeat last command it sent)
|-
| 0xFF
| Key detection error or internal buffer overrun
|}
 
All other bytes sent by the keyboard are scan codes, where interpretation depends on the currently selected scan code set.
 
== Driver Model ==
!! Ctrl, Alt, shift, etc.
 
=== Command Queue and State Machine ===
The keyboard only reports _keystrokes_. That means it makes no difference between an uppercase 'A' and a lowercase 'a' when you hit the key. The trick is that you'll get two kind of scancodes: _make_ codes and _break_ codes, depending on whether you hit or release the key. For instance if you type an uppercase 'A', you'll get
<verbatim>
0x2A (make shift)
0x1E (make A)
0x9E (break A)
0xAA (break shift)
</verbatim>
 
Commands must be sent one at a time (e.g. if your driver is interrupt driven, you can't start sending a command within the IRQ handler because code outside the IRQ handler may be in the middle of sending a command). The command isn't completed until you've received an ACK for it. For example, if you send a command and the keyboard responds with "0xFE (resend)" then you have to send the command again (possibly limited to 3 retries before you give up and assume the keyboard doesn't support the command you're sending or there's been a hardware failure). Finally, sometimes you want to send several commands at once. For example, you might have a "reinitialise()" function that sets the scan code set, sets the typematic byte, sets the LEDs and enables scanning.
Similarily, when you type 'hi' with the CTRL key hold down, your keyboard sends the codes 1d, 23, a3, 17, 97, 9d to the CPU. That means if you want to interprete character 'A' differently based on whether the 'SHIFT' key is up or down, you have first to _remember_ the state of the shift key.
 
The simplest way to achieve this is for the driver to maintain a queue of commands. When you add a command to the queue, if the queue is empty you start sending the command; otherwise you append the command to the queue. When you receive an "0xFA (ACK)" from the keyboard you discard the command at the head of the queue and start sending the next command in the queue (if any). If you receive an "0xFE (Resend)" from the keyboard you can resend the command at the head of the queue.
<verbatim>
char lowercase[256] = {0x1E:'a'};
char uppercase[256] = {0x1E:'A'};
 
The remainder of the driver should be a kind of state machine. The state machine moves into a different state when some commands are successfully completed, and when various bytes are received from the keyboard. For example, the driver might be in a default state and receive a break code that puts it into a "waiting for scan code after receiving break code" state. Then it might receive the first byte of a multi-byte scan code and shift to a "waiting for second byte of scan code after receiving break code" state. Finally it might receive the second/last byte of the scan code and then switch back to the default state.
unsigned shift_state = 0;
 
void KeyboardIsr()
{
byte new_scan_code = inportb(0x60);
switch(new_scan_code) {
case 0x2a: shift_state = 1; break;
case 0xaa: shift_state = 0; break;
default:
if (new_scan_code & 0x80) {
// ignore the break code
} else {
new_char=(shift_state?uppercase:lowercase)[new_scan_code];
// do something with new_char
}
break;
 
=== Scan Code Sets, Scan Codes and Key Codes ===
outportb(0x20,0x20);
}
</verbatim>
 
A scan code set is a set of codes that determine when a key is pressed or repeated, or released. There are 3 different sets of scan codes. The oldest is "scan code set 1", the default is "scan code set 2", and there is a newer (more complex) "scan code set 3". ''Note: Normally on PC compatible systems the keyboard itself uses scan code set 2 and the keyboard controller translates this into scan code set 1 for compatibility. See [["8042"_PS/2_Controller#Translation|"8042"_PS/2_Controller]] for more information about this translation.''
The arrays =lowercase= and =uppercase= are the _conversion arrays_, also called _keyboard map_. A different keyboard language will lead to different keyboard maps, so you're welcome to provide an API call that will allow the change of that map. You might also want an =alternate= map for characters composed with ~[ALTgr] key hold down or a =wchar_t= based map that will allow you to map a keystroke directly to unicode characters.
 
Modern keyboards should support all three scan code sets, however some don't. Scan code set 2 (the default) is the only scan code set that is guaranteed to be supported. In theory (I haven't tried it) it should be possible to attempt to set scan code set 1 or scan code set 3, and then ask the keyboard which scan code it is currently using and see if it actually is using the requested scan code set. In this way it may be possible to determine which scan code sets the keyboard does support.
 
Scan codes themselves are sequences of one or more bytes. In some cases the sequence can be as many as 6 bytes (e.g. the Pause/Break key in scan code set 1
!! What's that E0 scancode i get all the time ?
generates the sequence 0xE1, 0x1D, 0x45, 0xE1, 0x9D, 0xC5 when pressed). This situation isn't really ideal. In general (for later processing) you want to convert these "one or more byte sequences" into a single integer that uniquely identifies a specific key, that can be used effectively in things like lookup tables (without having sparsely used "many GiB" lookup tables).
 
There is no standard for "key codes" - it's something you have to make up or invent for your OS. I personally like the idea of having an 8-bit key code where the highest 3 bits determine which row on the keyboard and the lowest 5 bits determine which column (essentially, the keyboard is treated as a grid of up to 8 rows and up to 32 columns of keys). Regardless of what you choose to use for your key codes, it should be something that is used by all keyboard drivers (including USB Keyboards) and could possibly also be used for other input devices (e.g. left mouse button might be treated as "key code 0xF1").
Several keys on your keyboard have a two-bytes scan code (they're said to be _escaped_ scancodes). All those codes start with 0xe0 and are then followed by the 'real' scancode, which means when receiving scancode 0xe0, you should just store the info and wait for the next scancode to know what key even actually occured.
 
Basically, when the keyboard driver's state machine knows it has received a complete scan code, the next step is to convert the "one or more byte" scan code into a key code.
If you look at the list of escaped scancodes on http://www.win.tue.nl/~~aeb/linux/kbd/scancodes.html, you'll note that none of them correspond to a 'printable' character.
 
=== Key Codes, Key States and Key Mappings ===
<verbatim>
unsigned shift_state = 0;
unsigned escaped=0;
 
Once you've got key codes, then next step is to keep track of which keys are currently being pressed. Imagine a computer game that uses the "WASD" keys for player movement - when the 'A' key is being pressed the player rotates clockwise. How does the game know if the 'A' key is currently being pressed? For this you'd want an array of flags, where each flag corresponds to a key code. There is a hidden bonus here - the keyboard driver itself can use the same "array of flags" to determine if a shift key, control key, alt key, etc is down, which can be quite useful when trying to convert the key code into an actual ASCII character or Unicode code point. For example, if the user presses the 'a' key then it might correspond to 'a' or 'A' (depending on capslock state and whether or not a shift key is being held down at the time) or might not correspond to a valid character at all (e.g. "control-a" or "alt-a").
void KeyboardIsr()
{
unsigned new_scan_code = inportb(0x60);
if (escaped) new_scan_code += 256;
switch(new_scan_code) {
case 0x2a: shift_state = 1; break;
case 0xaa: shift_state = 0; break;
case 0xe0: escaped = 1; break;
default:
if (new_scan_code & 0x80) {
// ignore the break code
} else {
new_char=(shift_state?uppercase:lowercase)[new_scan_code];
// do something with new_char
}
break;
 
Also note that (for example) a "WASD" game doesn't care if the keys are 'W', 'A', 'S' and 'D'. The game wants to know about keys in a specific "T-shaped" pattern on the left of the keyboard. If the keyboard happens to be something different, then the keys in the same location may be completely different (e.g. they would be '<', 'A', 'O' and 'E' keys on a Dvorak keyboard). This helps to explain my preference of having an 8-bit key code where the highest 3 bits determine which row on the keyboard and the lowest 5 bits determine which column (it's easy for a game to ask about the state of the third key on the left of the third row).
outportb(0x20,0x20);
}
</verbatim>
 
Once you're able to keep track of which keys are currently being pressed, the next step is to (attempt to) convert the key into an ASCII character or Unicode code point. At this point you need to know what type of keyboard the user has - is it "US QWERTY", or "French AZERTY", some form of Dvorak, or perhaps it's Arabic. To handle many different keyboard layouts, the keyboard driver needs to use tables to convert key codes into ASCII characters or Unicode code points; so that you only need to load a different "Key Mapping" table to support different keyboard layouts.
 
However, it's not quite that simple. Different keyboard layouts can have different meta keys, different status LEDs, etc. The Key Mapping table has to sort these differences out too. This is why you don't want to detect if the keyboard LEDs have changed earlier, but want to send the "set LEDs" command (if necessary) *after* you've found the entry for the key code in your key map table.
!! What should i do with non-printable characters ?
 
The final step of processing is to combine all relevant information into some sort of "keypress packet" structure, and send it to whomever (e.g. GUI). The entire "keypress packet" might include the following:
ToDo: think about it. We can however already say that they should follow the same 'datapath' as regular characters: we want cursor displacements, regular keytypes and commands (such as CTRL+S) to be delivered to the application in the same order the user typed them, and the best way to achieve this is to ensure they're delivered through the same data stream.
* Unicode code point (if applicable)
* Key code
* Pressed/released flag
* Various other key states (shift, alt, control, etc)
* Various "toggle" states (CapsLock, ScrollLock, NumberLock, etc)
 
== Scan Code Sets ==
 
As there are 3 different scan code sets, there are 3 different tables (one for each scan code set). Some of the scan codes correspond to extra keys that have been added over time and have become "relatively standard". To help keep track scan codes have been categorized and tagged in the tables below. The tags used are:
!! How can i support non-latin characters ?
 
{| {{wikitable}}
In case you'd like to write an OS with support of arabic, kanji or whatever, you'll at least need support for Unicode. We had a thread about [loading arabic fonts|Forum:7657] on the forum, which you might like to look at.
|-
! Tag
! Meaning
|-
| (keypad)
| A key that is on the numerics keypad (typically found on the right hand side of the keyboard).
|-
| (ACPI)
| A key that is part of the "ACPI" group of keys (typically found near the top of the keyboard). A lot of modern keyboards don't actually have these keys (if I remember right, they were fashionable in the late 1990's but have become less common since).
Note: Don't let the name fool you - these keys have nothing to do with ACPI at all and do behave like any other normal key (but could be useful for an OS that supports power management).
|-
| (multimedia)
| A key that is part of the multimedia group of keys (typically found near the top of the keyboard). A lot of modern keyboards do have at least some of these keys. Some of these keys are intended to be used for media players (volume control, play/pause, next track, previous track, etc), some are intended for web browsing (previous web page, next web page, refresh, favourites/bookmarks, etc), and and some are intended for launching applications (e.g. starting an email client, starting a calculator, opening "my computer", etc).
|}
 
Anyway, please consider the following: even if your userbase is mainly arabic/japanese/whatever, your guru base is likely to be internationnal and to prefer messages about "queue" or "thread" than about whatever the translation might look like, so english might be preferred for "behind the scene" stuff ...
 
=== Scan Code Set 1 ===
 
The following table shows which scan codes correspond to which keys when using scan code set 1 (for a "US QWERTY" keyboard only):
 
Note that scancodes with extended byte (E0) generates two different interrupts: the first containing the E0 byte, the second containing the scancode
----
{| {{wikitable}}
!Related threads
|-
[Keyboard input | Forum:6451]
! Scan code
[Up or down press? | Forum:6479]
! Key
[Change typerate | Forum:6395]
! style="background: #E8E8E8" | Scan code
[Converting the scancodes | Forum:6304]
! style="background: #E8E8E8" | Key
[Discussion about keyb. input in a GUI | Forum:5919]
! Scan code
[Scroll-lock LED | Forum:6213]
! Key
[Keyboard LEDs (C source) | Forum:7182]
! style="background: #E8E8E8" | Scan code
[Keyboard LEDs (asm source) | Forum:7009]
! style="background: #E8E8E8" | Key
|-
|
|
| style="background: #E8E8E8" align="right" | 0x01
| style="background: #E8E8E8" | escape pressed
| align="right" | 0x02
| 1 pressed
| style="background: #E8E8E8" align="right" | 0x03
| style="background: #E8E8E8" | 2 pressed
|-
| align="right" | 0x04
| 3 pressed
| style="background: #E8E8E8" align="right" | 0x05
| style="background: #E8E8E8" | 4 pressed
| align="right" | 0x06
| 5 pressed
| style="background: #E8E8E8" align="right" | 0x07
| style="background: #E8E8E8" | 6 pressed
|-
| align="right" | 0x08
| 7 pressed
| style="background: #E8E8E8" align="right" | 0x09
| style="background: #E8E8E8" | 8 pressed
| align="right" | 0x0A
| 9 pressed
| style="background: #E8E8E8" align="right" | 0x0B
| style="background: #E8E8E8" | 0 (zero) pressed
|-
| align="right" | 0x0C
| - pressed
| style="background: #E8E8E8" align="right" | 0x0D
| style="background: #E8E8E8" | = pressed
| align="right" | 0x0E
| backspace pressed
| style="background: #E8E8E8" align="right" | 0x0F
| style="background: #E8E8E8" | tab pressed
|-
| align="right" | 0x10
| Q pressed
| style="background: #E8E8E8" align="right" | 0x11
| style="background: #E8E8E8" | W pressed
| align="right" | 0x12
| E pressed
| style="background: #E8E8E8" align="right" | 0x13
| style="background: #E8E8E8" | R pressed
|-
| align="right" | 0x14
| T pressed
| style="background: #E8E8E8" align="right" | 0x15
| style="background: #E8E8E8" | Y pressed
| align="right" | 0x16
| U pressed
| style="background: #E8E8E8" align="right" | 0x17
| style="background: #E8E8E8" | I pressed
|-
| align="right" | 0x18
| O pressed
| style="background: #E8E8E8" align="right" | 0x19
| style="background: #E8E8E8" | P pressed
| align="right" | 0x1A
| [ pressed
| style="background: #E8E8E8" align="right" | 0x1B
| style="background: #E8E8E8" | ] pressed
|-
| align="right" | 0x1C
| enter pressed
| style="background: #E8E8E8" align="right" | 0x1D
| style="background: #E8E8E8" | left control pressed
| align="right" | 0x1E
| A pressed
| style="background: #E8E8E8" align="right" | 0x1F
| style="background: #E8E8E8" | S pressed
|-
| align="right" | 0x20
| D pressed
| style="background: #E8E8E8" align="right" | 0x21
| style="background: #E8E8E8" | F pressed
| align="right" | 0x22
| G pressed
| style="background: #E8E8E8" align="right" | 0x23
| style="background: #E8E8E8" | H pressed
|-
| align="right" | 0x24
| J pressed
| style="background: #E8E8E8" align="right" | 0x25
| style="background: #E8E8E8" | K pressed
| align="right" | 0x26
| L pressed
| style="background: #E8E8E8" align="right" | 0x27
| style="background: #E8E8E8" | ; pressed
|-
| align="right" | 0x28
| ' (single quote) pressed
| style="background: #E8E8E8" align="right" | 0x29
| style="background: #E8E8E8" | ` (back tick) pressed
| align="right" | 0x2A
| left shift pressed
| style="background: #E8E8E8" align="right" | 0x2B
| style="background: #E8E8E8" | \ pressed
|-
| align="right" | 0x2C
| Z pressed
| style="background: #E8E8E8" align="right" | 0x2D
| style="background: #E8E8E8" | X pressed
| align="right" | 0x2E
| C pressed
| style="background: #E8E8E8" align="right" | 0x2F
| style="background: #E8E8E8" | V pressed
|-
| align="right" | 0x30
| B pressed
| style="background: #E8E8E8" align="right" | 0x31
| style="background: #E8E8E8" | N pressed
| align="right" | 0x32
| M pressed
| style="background: #E8E8E8" align="right" | 0x33
| style="background: #E8E8E8" | , pressed
|-
| align="right" | 0x34
| . pressed
| style="background: #E8E8E8" align="right" | 0x35
| style="background: #E8E8E8" | / pressed
| align="right" | 0x36
| right shift pressed
| style="background: #E8E8E8" align="right" | 0x37
| style="background: #E8E8E8" | (keypad) * pressed
|-
| align="right" | 0x38
| left alt pressed
| style="background: #E8E8E8" align="right" | 0x39
| style="background: #E8E8E8" | space pressed
| align="right" | 0x3A
| CapsLock pressed
| style="background: #E8E8E8" align="right" | 0x3B
| style="background: #E8E8E8" | F1 pressed
|-
| align="right" | 0x3C
| F2 pressed
| style="background: #E8E8E8" align="right" | 0x3D
| style="background: #E8E8E8" | F3 pressed
| align="right" | 0x3E
| F4 pressed
| style="background: #E8E8E8" align="right" | 0x3F
| style="background: #E8E8E8" | F5 pressed
|-
| align="right" | 0x40
| F6 pressed
| style="background: #E8E8E8" align="right" | 0x41
| style="background: #E8E8E8" | F7 pressed
| align="right" | 0x42
| F8 pressed
| style="background: #E8E8E8" align="right" | 0x43
| style="background: #E8E8E8" | F9 pressed
|-
| align="right" | 0x44
| F10 pressed
| style="background: #E8E8E8" align="right" | 0x45
| style="background: #E8E8E8" | NumberLock pressed
| align="right" | 0x46
| ScrollLock pressed
| style="background: #E8E8E8" align="right" | 0x47
| style="background: #E8E8E8" | (keypad) 7 pressed
|-
| align="right" | 0x48
| (keypad) 8 pressed
| style="background: #E8E8E8" align="right" | 0x49
| style="background: #E8E8E8" | (keypad) 9 pressed
| align="right" | 0x4A
| (keypad) - pressed
| style="background: #E8E8E8" align="right" | 0x4B
| style="background: #E8E8E8" | (keypad) 4 pressed
|-
| align="right" | 0x4C
| (keypad) 5 pressed
| style="background: #E8E8E8" align="right" | 0x4D
| style="background: #E8E8E8" | (keypad) 6 pressed
| align="right" | 0x4E
| (keypad) + pressed
| style="background: #E8E8E8" align="right" | 0x4F
| style="background: #E8E8E8" | (keypad) 1 pressed
|-
| align="right" | 0x50
| (keypad) 2 pressed
| style="background: #E8E8E8" align="right" | 0x51
| style="background: #E8E8E8" | (keypad) 3 pressed
| align="right" | 0x52
| (keypad) 0 pressed
| style="background: #E8E8E8" align="right" | 0x53
| style="background: #E8E8E8" | (keypad) . pressed
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0x57
| style="background: #E8E8E8" | F11 pressed
|-
| align="right" | 0x58
| F12 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x81
| style="background: #E8E8E8" | escape released
| align="right" | 0x82
| 1 released
| style="background: #E8E8E8" align="right" | 0x83
| style="background: #E8E8E8" | 2 released
|-
| align="right" | 0x84
| 3 released
| style="background: #E8E8E8" align="right" | 0x85
| style="background: #E8E8E8" | 4 released
| align="right" | 0x86
| 5 released
| style="background: #E8E8E8" align="right" | 0x87
| style="background: #E8E8E8" | 6 released
|-
| align="right" | 0x88
| 7 released
| style="background: #E8E8E8" align="right" | 0x89
| style="background: #E8E8E8" | 8 released
| align="right" | 0x8A
| 9 released
| style="background: #E8E8E8" align="right" | 0x8B
| style="background: #E8E8E8" | 0 (zero) released
|-
| align="right" | 0x8C
| - released
| style="background: #E8E8E8" align="right" | 0x8D
| style="background: #E8E8E8" | = released
| align="right" | 0x8E
| backspace released
| style="background: #E8E8E8" align="right" | 0x8F
| style="background: #E8E8E8" | tab released
|-
| align="right" | 0x90
| Q released
| style="background: #E8E8E8" align="right" | 0x91
| style="background: #E8E8E8" | W released
| align="right" | 0x92
| E released
| style="background: #E8E8E8" align="right" | 0x93
| style="background: #E8E8E8" | R released
|-
| align="right" | 0x94
| T released
| style="background: #E8E8E8" align="right" | 0x95
| style="background: #E8E8E8" | Y released
| align="right" | 0x96
| U released
| style="background: #E8E8E8" align="right" | 0x97
| style="background: #E8E8E8" | I released
|-
| align="right" | 0x98
| O released
| style="background: #E8E8E8" align="right" | 0x99
| style="background: #E8E8E8" | P released
| align="right" | 0x9A
| [ released
| style="background: #E8E8E8" align="right" | 0x9B
| style="background: #E8E8E8" | ] released
|-
| align="right" | 0x9C
| enter released
| style="background: #E8E8E8" align="right" | 0x9D
| style="background: #E8E8E8" | left control released
| align="right" | 0x9E
| A released
| style="background: #E8E8E8" align="right" | 0x9F
| style="background: #E8E8E8" | S released
|-
| align="right" | 0xA0
| D released
| style="background: #E8E8E8" align="right" | 0xA1
| style="background: #E8E8E8" | F released
| align="right" | 0xA2
| G released
| style="background: #E8E8E8" align="right" | 0xA3
| style="background: #E8E8E8" | H released
|-
| align="right" | 0xA4
| J released
| style="background: #E8E8E8" align="right" | 0xA5
| style="background: #E8E8E8" | K released
| align="right" | 0xA6
| L released
| style="background: #E8E8E8" align="right" | 0xA7
| style="background: #E8E8E8" | ; released
|-
| align="right" | 0xA8
| ' (single quote) released
| style="background: #E8E8E8" align="right" | 0xA9
| style="background: #E8E8E8" | ` (back tick) released
| align="right" | 0xAA
| left shift released
| style="background: #E8E8E8" align="right" | 0xAB
| style="background: #E8E8E8" | \ released
|-
| align="right" | 0xAC
| Z released
| style="background: #E8E8E8" align="right" | 0xAD
| style="background: #E8E8E8" | X released
| align="right" | 0xAE
| C released
| style="background: #E8E8E8" align="right" | 0xAF
| style="background: #E8E8E8" | V released
|-
| align="right" | 0xB0
| B released
| style="background: #E8E8E8" align="right" | 0xB1
| style="background: #E8E8E8" | N released
| align="right" | 0xB2
| M released
| style="background: #E8E8E8" align="right" | 0xB3
| style="background: #E8E8E8" | , released
|-
| align="right" | 0xB4
| . released
| style="background: #E8E8E8" align="right" | 0xB5
| style="background: #E8E8E8" | / released
| align="right" | 0xB6
| right shift released
| style="background: #E8E8E8" align="right" | 0xB7
| style="background: #E8E8E8" | (keypad) * released
|-
| align="right" | 0xB8
| left alt released
| style="background: #E8E8E8" align="right" | 0xB9
| style="background: #E8E8E8" | space released
| align="right" | 0xBA
| CapsLock released
| style="background: #E8E8E8" align="right" | 0xBB
| style="background: #E8E8E8" | F1 released
|-
| align="right" | 0xBC
| F2 released
| style="background: #E8E8E8" align="right" | 0xBD
| style="background: #E8E8E8" | F3 released
| align="right" | 0xBE
| F4 released
| style="background: #E8E8E8" align="right" | 0xBF
| style="background: #E8E8E8" | F5 released
|-
| align="right" | 0xC0
| F6 released
| style="background: #E8E8E8" align="right" | 0xC1
| style="background: #E8E8E8" | F7 released
| align="right" | 0xC2
| F8 released
| style="background: #E8E8E8" align="right" | 0xC3
| style="background: #E8E8E8" | F9 released
|-
| align="right" | 0xC4
| F10 released
| style="background: #E8E8E8" align="right" | 0xC5
| style="background: #E8E8E8" | NumberLock released
| align="right" | 0xC6
| ScrollLock released
| style="background: #E8E8E8" align="right" | 0xC7
| style="background: #E8E8E8" | (keypad) 7 released
|-
| align="right" | 0xC8
| (keypad) 8 released
| style="background: #E8E8E8" align="right" | 0xC9
| style="background: #E8E8E8" | (keypad) 9 released
| align="right" | 0xCA
| (keypad) - released
| style="background: #E8E8E8" align="right" | 0xCB
| style="background: #E8E8E8" | (keypad) 4 released
|-
| align="right" | 0xCC
| (keypad) 5 released
| style="background: #E8E8E8" align="right" | 0xCD
| style="background: #E8E8E8" | (keypad) 6 released
| align="right" | 0xCE
| (keypad) + released
| style="background: #E8E8E8" align="right" | 0xCF
| style="background: #E8E8E8" | (keypad) 1 released
|-
| align="right" | 0xD0
| (keypad) 2 released
| style="background: #E8E8E8" align="right" | 0xD1
| style="background: #E8E8E8" | (keypad) 3 released
| align="right" | 0xD2
| (keypad) 0 released
| style="background: #E8E8E8" align="right" | 0xD3
| style="background: #E8E8E8" | (keypad) . released
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xD7
| style="background: #E8E8E8" | F11 released
|-
| align="right" | 0xD8
| F12 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x10
| (multimedia) previous track pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x19
| style="background: #E8E8E8" | (multimedia) next track pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x1C
| (keypad) enter pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x1D
| style="background: #E8E8E8" | right control pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x20
| (multimedia) mute pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x21
| style="background: #E8E8E8" | (multimedia) calculator pressed
| align="right" | 0xE0, 0x22
| (multimedia) play pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x24
| (multimedia) stop pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x2E
| (multimedia) volume down pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x30
| (multimedia) volume up pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x32
| (multimedia) WWW home pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x35
| style="background: #E8E8E8" | (keypad) / pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x38
| right alt (or altGr) pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x47
| style="background: #E8E8E8" | home pressed
|-
| align="right" | 0xE0, 0x48
| cursor up pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x49
| style="background: #E8E8E8" | page up pressed
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x4B
| style="background: #E8E8E8" | cursor left pressed
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x4D
| style="background: #E8E8E8" | cursor right pressed
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x4F
| style="background: #E8E8E8" | end pressed
|-
| align="right" | 0xE0, 0x50
| cursor down pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x51
| style="background: #E8E8E8" | page down pressed
| align="right" | 0xE0, 0x52
| insert pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x53
| style="background: #E8E8E8" | delete pressed
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x5B
| style="background: #E8E8E8" | left GUI pressed
|-
| align="right" | 0xE0, 0x5C
| right GUI pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x5D
| style="background: #E8E8E8" | "apps" pressed
| align="right" | 0xE0, 0x5E
| (ACPI) power pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x5F
| style="background: #E8E8E8" | (ACPI) sleep pressed
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x63
| style="background: #E8E8E8" | (ACPI) wake pressed
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x65
| style="background: #E8E8E8" | (multimedia) WWW search pressed
| align="right" | 0xE0, 0x66
| (multimedia) WWW favorites pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x67
| style="background: #E8E8E8" | (multimedia) WWW refresh pressed
|-
| align="right" | 0xE0, 0x68
| (multimedia) WWW stop pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x69
| style="background: #E8E8E8" | (multimedia) WWW forward pressed
| align="right" | 0xE0, 0x6A
| (multimedia) WWW back pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x6B
| style="background: #E8E8E8" | (multimedia) my computer pressed
|-
| align="right" | 0xE0, 0x6C
| (multimedia) email pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x6D
| style="background: #E8E8E8" | (multimedia) media select pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x90
| (multimedia) previous track released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x99
| style="background: #E8E8E8" | (multimedia) next track released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x9C
| (keypad) enter released
| style="background: #E8E8E8" align="right" | 0xE0, 0x9D
| style="background: #E8E8E8" | right control released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xA0
| (multimedia) mute released
| style="background: #E8E8E8" align="right" | 0xE0, 0xA1
| style="background: #E8E8E8" | (multimedia) calculator released
| align="right" | 0xE0, 0xA2
| (multimedia) play released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xA4
| (multimedia) stop released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xAE
| (multimedia) volume down released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xB0
| (multimedia) volume up released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xB2
| (multimedia) WWW home released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xB5
| style="background: #E8E8E8" | (keypad) / released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xB8
| right alt (or altGr) released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xC7
| style="background: #E8E8E8" | home released
|-
| align="right" | 0xE0, 0xC8
| cursor up released
| style="background: #E8E8E8" align="right" | 0xE0, 0xC9
| style="background: #E8E8E8" | page up released
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xCB
| style="background: #E8E8E8" | cursor left released
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xCD
| style="background: #E8E8E8" | cursor right released
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xCF
| style="background: #E8E8E8" | end released
|-
| align="right" | 0xE0, 0xD0
| cursor down released
| style="background: #E8E8E8" align="right" | 0xE0, 0xD1
| style="background: #E8E8E8" | page down released
| align="right" | 0xE0, 0xD2
| insert released
| style="background: #E8E8E8" align="right" | 0xE0, 0xD3
| style="background: #E8E8E8" | delete released
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xDB
| style="background: #E8E8E8" | left GUI released
|-
| align="right" | 0xE0, 0xDC
| right GUI released
| style="background: #E8E8E8" align="right" | 0xE0, 0xDD
| style="background: #E8E8E8" | "apps" released
| align="right" | 0xE0, 0xDE
| (ACPI) power released
| style="background: #E8E8E8" align="right" | 0xE0, 0xDF
| style="background: #E8E8E8" | (ACPI) sleep released
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xE3
| style="background: #E8E8E8" | (ACPI) wake released
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xE5
| style="background: #E8E8E8" | (multimedia) WWW search released
| align="right" | 0xE0, 0xE6
| (multimedia) WWW favorites released
| style="background: #E8E8E8" align="right" | 0xE0, 0xE7
| style="background: #E8E8E8" | (multimedia) WWW refresh released
|-
| align="right" | 0xE0, 0xE8
| (multimedia) WWW stop released
| style="background: #E8E8E8" align="right" | 0xE0, 0xE9
| style="background: #E8E8E8" | (multimedia) WWW forward released
| align="right" | 0xE0, 0xEA
| (multimedia) WWW back released
| style="background: #E8E8E8" align="right" | 0xE0, 0xEB
| style="background: #E8E8E8" | (multimedia) my computer released
|-
| align="right" | 0xE0, 0xEC
| (multimedia) email released
| style="background: #E8E8E8" align="right" | 0xE0, 0xED
| style="background: #E8E8E8" | (multimedia) media select released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x2A, 0xE0, 0x37
| style="background: #E8E8E8" | print screen pressed
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xB7, 0xE0, 0xAA
| style="background: #E8E8E8" | print screen released
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE1, 0x1D, 0x45, 0xE1, 0x9D, 0xC5
| style="background: #E8E8E8" | pause pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|}
 
 
----
Note: There is no scan code for "pause key released" (it behaves as if it is released as soon as it's pressed)
!Todo:
 
Add info on: scan codes, changing led lights, handle shift/caps etc,etc...
=== Scan Code Set 2 ===
Maybe change name to "Keyboard programming" or similar, since it's not only about getting a key.
 
The following table shows which "make" scan codes correspond to which keys when using scan code set 2 (for a "US QWERTY" keyboard only):
 
{| {{wikitable}}
|-
! Scan code
! Key
! style="background: #E8E8E8" | Scan code
! style="background: #E8E8E8" | Key
! Scan code
! Key
! style="background: #E8E8E8" | Scan code
! style="background: #E8E8E8" | Key
|-
|
|
| style="background: #E8E8E8" align="right" | 0x01
| style="background: #E8E8E8" | F9 pressed
|
|
| style="background: #E8E8E8" align="right" | 0x03
| style="background: #E8E8E8" | F5 pressed
|-
| align="right" | 0x04
| F3 pressed
| style="background: #E8E8E8" align="right" | 0x05
| style="background: #E8E8E8" | F1 pressed
| align="right" | 0x06
| F2 pressed
| style="background: #E8E8E8" align="right" | 0x07
| style="background: #E8E8E8" | F12 pressed
|-
|
|
| style="background: #E8E8E8" align="right" | 0x09
| style="background: #E8E8E8" | F10 pressed
| align="right" | 0x0A
| F8 pressed
| style="background: #E8E8E8" align="right" | 0x0B
| style="background: #E8E8E8" | F6 pressed
|-
| align="right" | 0x0C
| F4 pressed
| style="background: #E8E8E8" align="right" | 0x0D
| style="background: #E8E8E8" | tab pressed
| align="right" | 0x0E
| ` (back tick) pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x11
| style="background: #E8E8E8" | left alt pressed
| align="right" | 0x12
| left shift pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0x14
| left control pressed
| style="background: #E8E8E8" align="right" | 0x15
| style="background: #E8E8E8" | Q pressed
| align="right" | 0x16
| 1 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0x1A
| Z pressed
| style="background: #E8E8E8" align="right" | 0x1B
| style="background: #E8E8E8" | S pressed
|-
| align="right" | 0x1C
| A pressed
| style="background: #E8E8E8" align="right" | 0x1D
| style="background: #E8E8E8" | W pressed
| align="right" | 0x1E
| 2 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x21
| style="background: #E8E8E8" | C pressed
| align="right" | 0x22
| X pressed
| style="background: #E8E8E8" align="right" | 0x23
| style="background: #E8E8E8" | D pressed
|-
| align="right" | 0x24
| E pressed
| style="background: #E8E8E8" align="right" | 0x25
| style="background: #E8E8E8" | 4 pressed
| align="right" | 0x26
| 3 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x29
| style="background: #E8E8E8" | space pressed
| align="right" | 0x2A
| V pressed
| style="background: #E8E8E8" align="right" | 0x2B
| style="background: #E8E8E8" | F pressed
|-
| align="right" | 0x2C
| T pressed
| style="background: #E8E8E8" align="right" | 0x2D
| style="background: #E8E8E8" | R pressed
| align="right" | 0x2E
| 5 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x31
| style="background: #E8E8E8" | N pressed
| align="right" | 0x32
| B pressed
| style="background: #E8E8E8" align="right" | 0x33
| style="background: #E8E8E8" | H pressed
|-
| align="right" | 0x34
| G pressed
| style="background: #E8E8E8" align="right" | 0x35
| style="background: #E8E8E8" | Y pressed
| align="right" | 0x36
| 6 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0x3A
| M pressed
| style="background: #E8E8E8" align="right" | 0x3B
| style="background: #E8E8E8" | J pressed
|-
| align="right" | 0x3C
| U pressed
| style="background: #E8E8E8" align="right" | 0x3D
| style="background: #E8E8E8" | 7 pressed
| align="right" | 0x3E
| 8 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x41
| style="background: #E8E8E8" | , pressed
| align="right" | 0x42
| K pressed
| style="background: #E8E8E8" align="right" | 0x43
| style="background: #E8E8E8" | I pressed
|-
| align="right" | 0x44
| O pressed
| style="background: #E8E8E8" align="right" | 0x45
| style="background: #E8E8E8" | 0 (zero) pressed
| align="right" | 0x46
| 9 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x49
| style="background: #E8E8E8" | . pressed
| align="right" | 0x4A
| / pressed
| style="background: #E8E8E8" align="right" | 0x4B
| style="background: #E8E8E8" | L pressed
|-
| align="right" | 0x4C
| ; pressed
| style="background: #E8E8E8" align="right" | 0x4D
| style="background: #E8E8E8" | P pressed
| align="right" | 0x4E
| - pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0x52
| ' pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0x54
| [ pressed
| style="background: #E8E8E8" align="right" | 0x55
| style="background: #E8E8E8" | = pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0x58
| CapsLock pressed
| style="background: #E8E8E8" align="right" | 0x59
| style="background: #E8E8E8" | right shift pressed
| align="right" | 0x5A
| enter pressed
| style="background: #E8E8E8" align="right" | 0x5B
| style="background: #E8E8E8" | ] pressed
|-
|
|
| style="background: #E8E8E8" align="right" | 0x5D
| style="background: #E8E8E8" | \ pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" | &nbsp;
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0x66
| backspace pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0x69
| style="background: #E8E8E8" | (keypad) 1 pressed
|
|
| style="background: #E8E8E8" align="right" | 0x6B
| style="background: #E8E8E8" | (keypad) 4 pressed
|-
| align="right" | 0x6C
| (keypad) 7 pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0x70
| (keypad) 0 pressed
| style="background: #E8E8E8" align="right" | 0x71
| style="background: #E8E8E8" | (keypad) . pressed
| align="right" | 0x72
| (keypad) 2 pressed
| style="background: #E8E8E8" align="right" | 0x73
| style="background: #E8E8E8" | (keypad) 5 pressed
|-
| align="right" | 0x74
| (keypad) 6 pressed
| style="background: #E8E8E8" align="right" | 0x75
| style="background: #E8E8E8" | (keypad) 8 pressed
| align="right" | 0x76
| escape pressed
| style="background: #E8E8E8" align="right" | 0x77
| style="background: #E8E8E8" | NumberLock pressed
|-
| align="right" | 0x78
| F11 pressed
| style="background: #E8E8E8" align="right" | 0x79
| style="background: #E8E8E8" | (keypad) + pressed
| align="right" | 0x7A
| (keypad) 3 pressed
| style="background: #E8E8E8" align="right" | 0x7B
| style="background: #E8E8E8" | (keypad) - pressed
|-
| align="right" | 0x7C
| (keypad) * pressed
| style="background: #E8E8E8" align="right" | 0x7D
| style="background: #E8E8E8" | (keypad) 9 pressed
| align="right" | 0x7E
| ScrollLock pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0x83
| style="background: #E8E8E8" | F7 pressed
|-
| align="right" | 0xE0, 0x10
| (multimedia) WWW search pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x11
| style="background: #E8E8E8" | right alt pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x14
| right control pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x15
| style="background: #E8E8E8" | (multimedia) previous track pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x18
| (multimedia) WWW favourites pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x1F
| style="background: #E8E8E8" | left GUI pressed
|-
| align="right" | 0xE0, 0x20
| (multimedia) WWW refresh pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x21
| style="background: #E8E8E8" | (multimedia) volume down pressed
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x23
| style="background: #E8E8E8" | (multimedia) mute pressed
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x27
| style="background: #E8E8E8" | right GUI pressed
|-
| align="right" | 0xE0, 0x28
| (multimedia) WWW stop pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x2B
| style="background: #E8E8E8" | (multimedia) calculator pressed
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x2F
| style="background: #E8E8E8" | apps pressed
|-
| align="right" | 0xE0, 0x30
| (multimedia) WWW forward pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x32
| (multimedia) volume up pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x34
| (multimedia) play/pause pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x37
| style="background: #E8E8E8" | (ACPI) power pressed
|-
| align="right" | 0xE0, 0x38
| (multimedia) WWW back pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x3A
| (multimedia) WWW home pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x3B
| style="background: #E8E8E8" | (multimedia) stop pressed
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x3F
| style="background: #E8E8E8" | (ACPI) sleep pressed
|-
| align="right" | 0xE0, 0x40
| (multimedia) my computer pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x48
| (multimedia) email pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x4A
| (keypad) / pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x4D
| style="background: #E8E8E8" | (multimedia) next track pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x50
| (multimedia) media select pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x5A
| (keypad) enter pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x5E
| (ACPI) wake pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x69
| style="background: #E8E8E8" | end pressed
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x6B
| style="background: #E8E8E8" | cursor left pressed
|-
| align="right" | 0xE0, 0x6C
| home pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x70
| insert pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x71
| style="background: #E8E8E8" | delete pressed
| align="right" | 0xE0, 0x72
| cursor down pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0x74
| cursor right pressed
| style="background: #E8E8E8" align="right" | 0xE0, 0x75
| style="background: #E8E8E8" | cursor up pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0x7A
| page down pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0x7D
| style="background: #E8E8E8" | page up pressed
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x01
| style="background: #E8E8E8" | F9 released
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x03
| style="background: #E8E8E8" | F5 released
|-
| align="right" | 0xF0, 0x04
| F3 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x05
| style="background: #E8E8E8" | F1 released
| align="right" | 0xF0, 0x06
| F2 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x07
| style="background: #E8E8E8" | F12 released
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x09
| style="background: #E8E8E8" | F10 released
| align="right" | 0xF0, 0x0A
| F8 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x0B
| style="background: #E8E8E8" | F6 released
|-
| align="right" | 0xF0, 0x0C
| F4 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x0D
| style="background: #E8E8E8" | tab released
| align="right" | 0xF0, 0x0E
| ` (back tick) released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x11
| style="background: #E8E8E8" | left alt released
| align="right" | 0xF0, 0x12
| left shift released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xF0, 0x14
| left control released
| style="background: #E8E8E8" align="right" | 0xF0, 0x15
| style="background: #E8E8E8" | Q released
| align="right" | 0xF0, 0x16
| 1 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xF0, 0x1A
| Z released
| style="background: #E8E8E8" align="right" | 0xF0, 0x1B
| style="background: #E8E8E8" | S released
|-
| align="right" | 0xF0, 0x1C
| A released
| style="background: #E8E8E8" align="right" | 0xF0, 0x1D
| style="background: #E8E8E8" | W released
| align="right" | 0xF0, 0x1E
| 2 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x21
| style="background: #E8E8E8" | C released
| align="right" | 0xF0, 0x22
| X released
| style="background: #E8E8E8" align="right" | 0xF0, 0x23
| style="background: #E8E8E8" | D released
|-
| align="right" | 0xF0, 0x24
| E released
| style="background: #E8E8E8" align="right" | 0xF0, 0x25
| style="background: #E8E8E8" | 4 released
| align="right" | 0xF0, 0x26
| 3 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x29
| style="background: #E8E8E8" | space released
| align="right" | 0xF0, 0x2A
| V released
| style="background: #E8E8E8" align="right" | 0xF0, 0x2B
| style="background: #E8E8E8" | F released
|-
| align="right" | 0xF0, 0x2C
| T released
| style="background: #E8E8E8" align="right" | 0xF0, 0x2D
| style="background: #E8E8E8" | R released
| align="right" | 0xF0, 0x2E
| 5 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x31
| style="background: #E8E8E8" | N released
| align="right" | 0xF0, 0x32
| B released
| style="background: #E8E8E8" align="right" | 0xF0, 0x33
| style="background: #E8E8E8" | H released
|-
| align="right" | 0xF0, 0x34
| G released
| style="background: #E8E8E8" align="right" | 0xF0, 0x35
| style="background: #E8E8E8" | Y released
| align="right" | 0xF0, 0x36
| 6 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xF0, 0x3A
| M released
| style="background: #E8E8E8" align="right" | 0xF0, 0x3B
| style="background: #E8E8E8" | J released
|-
| align="right" | 0xF0, 0x3C
| U released
| style="background: #E8E8E8" align="right" | 0xF0, 0x3D
| style="background: #E8E8E8" | 7 released
| align="right" | 0xF0, 0x3E
| 8 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x41
| style="background: #E8E8E8" | , released
| align="right" | 0xF0, 0x42
| K released
| style="background: #E8E8E8" align="right" | 0xF0, 0x43
| style="background: #E8E8E8" | I released
|-
| align="right" | 0xF0, 0x44
| O released
| style="background: #E8E8E8" align="right" | 0xF0, 0x45
| style="background: #E8E8E8" | 0 (zero) released
| align="right" | 0xF0, 0x46
| 9 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x49
| style="background: #E8E8E8" | . released
| align="right" | 0xF0, 0x4A
| / released
| style="background: #E8E8E8" align="right" | 0xF0, 0x4B
| style="background: #E8E8E8" | L released
|-
| align="right" | 0xF0, 0x4C
| ; released
| style="background: #E8E8E8" align="right" | 0xF0, 0x4D
| style="background: #E8E8E8" | P released
| align="right" | 0xF0, 0x4E
| - released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xF0, 0x52
| ' released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xF0, 0x54
| [ released
| style="background: #E8E8E8" align="right" | 0xF0, 0x55
| style="background: #E8E8E8" | = released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xF0, 0x58
| CapsLock released
| style="background: #E8E8E8" align="right" | 0xF0, 0x59
| style="background: #E8E8E8" | right shift released
| align="right" | 0xF0, 0x5A
| enter released
| style="background: #E8E8E8" align="right" | 0xF0, 0x5B
| style="background: #E8E8E8" | ] released
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x5D
| style="background: #E8E8E8" | \ released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" | &nbsp;
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xF0, 0x66
| backspace released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x69
| style="background: #E8E8E8" | (keypad) 1 released
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x6B
| style="background: #E8E8E8" | (keypad) 4 released
|-
| align="right" | 0xF0, 0x6C
| (keypad) 7 released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xF0, 0x70
| (keypad) 0 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x71
| style="background: #E8E8E8" | (keypad) . released
| align="right" | 0xF0, 0x72
| (keypad) 2 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x73
| style="background: #E8E8E8" | (keypad) 5 released
|-
| align="right" | 0xF0, 0x74
| (keypad) 6 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x75
| style="background: #E8E8E8" | (keypad) 8 released
| align="right" | 0xF0, 0x76
| escape released
| style="background: #E8E8E8" align="right" | 0xF0, 0x77
| style="background: #E8E8E8" | NumberLock released
|-
| align="right" | 0xF0, 0x78
| F11 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x79
| style="background: #E8E8E8" | (keypad) + released
| align="right" | 0xF0, 0x7A
| (keypad) 3 released
| style="background: #E8E8E8" align="right" | 0xF0, 0x7B
| style="background: #E8E8E8" | (keypad) - released
|-
| align="right" | 0xF0, 0x7C
| (keypad) * released
| style="background: #E8E8E8" align="right" | 0xF0, 0x7D
| style="background: #E8E8E8" | (keypad) 9 released
| align="right" | 0xF0, 0x7E
| ScrollLock released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xF0, 0x83
| style="background: #E8E8E8" | F7 released
|-
| align="right" | 0xE0, 0x12, 0xE0, 0x7C
| print screen pressed
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x10
| (multimedia) WWW search released
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x11
| style="background: #E8E8E8" | right alt released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x14
| right control released
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x15
| style="background: #E8E8E8" | (multimedia) previous track released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x18
| (multimedia) WWW favourites released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x1F
| style="background: #E8E8E8" | left GUI released
|-
| align="right" | 0xE0, 0xF0, 0x20
| (multimedia) WWW refresh released
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x21
| style="background: #E8E8E8" | (multimedia) volume down released
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x23
| style="background: #E8E8E8" | (multimedia) mute released
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x27
| style="background: #E8E8E8" | right GUI released
|-
| align="right" | 0xE0, 0xF0, 0x28
| (multimedia) WWW stop released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x2B
| style="background: #E8E8E8" | (multimedia) calculator released
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x2F
| style="background: #E8E8E8" | apps released
|-
| align="right" | 0xE0, 0xF0, 0x30
| (multimedia) WWW forward released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xF0, 0x32
| (multimedia) volume up released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x34
| (multimedia) play/pause released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x37
| style="background: #E8E8E8" | (ACPI) power released
|-
| align="right" | 0xE0, 0xF0, 0x38
| (multimedia) WWW back released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xF0, 0x3A
| (multimedia) WWW home released
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x3B
| style="background: #E8E8E8" | (multimedia) stop released
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x3F
| style="background: #E8E8E8" | (ACPI) sleep released
|-
| align="right" | 0xE0, 0xF0, 0x40
| (multimedia) my computer released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x48
| (multimedia) email released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xF0, 0x4A
| (keypad) / released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x4D
| style="background: #E8E8E8" | (multimedia) next track released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x50
| (multimedia) media select released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xF0, 0x5A
| (keypad) enter released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xF0, 0x5E
| (ACPI) wake released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x69
| style="background: #E8E8E8" | end released
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x6B
| style="background: #E8E8E8" | cursor left released
|-
| align="right" | 0xE0, 0xF0, 0x6C
| home released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x70
| insert released
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x71
| style="background: #E8E8E8" | delete released
| align="right" | 0xE0, 0xF0, 0x72
| cursor down released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
| align="right" | 0xE0, 0xF0, 0x74
| cursor right released
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x75
| style="background: #E8E8E8" | cursor up released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xF0, 0x7A
| page down released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" align="right" | 0xE0, 0xF0, 0x7D
| style="background: #E8E8E8" | page up released
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
| align="right" | 0xE0, 0xF0, 0x7C, 0xE0, 0xF0, 0x12
| print screen released
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|-
|
|
| style="background: #E8E8E8" |
| style="background: #E8E8E8" |
|
|
| style="background: #E8E8E8" align="right" | 0xE1, 0x14, 0x77, 0xE1, 0xF0, 0x14, 0xF0, 0x77
| style="background: #E8E8E8" | pause pressed
|}
 
Note: There is no scan code for "pause key released" (it behaves as if it is released as soon as it's pressed)
 
=== Scan Code Set 3 ===
 
The following table shows which scan codes correspond to which keys when using scan code set 3 (for a "US QWERTY" keyboard only):
 
{| {{wikitable}}
|-
!Key
!Code for Scan code set 3
|-
|A || 1C
|-
|B || 32
|-
|C || 21
|-
|D || 23
|-
|E || 24
|-
|F || 2B
|-
|G || 34
|-
|H || 33
|-
|I || 43
|-
|J || 3B
|-
|K || 42
|-
|L || 4B
|-
|M || 3A
|-
|N || 31
|-
|O || 44
|-
|P || 4D
|-
|Q || 15
|-
|R || 2D
|-
|S || 1B
|-
|T || 2C
|-
|U || 3C
|-
|V || 2A
|-
|W || 1D
|-
|X || 22
|-
|Y || 35
|-
|Z || 1A
|}
 
[https://web.archive.org/web/20170108131104/http://www.computer-engineering.org/ps2keyboard/scancodes3.html Scan code]
 
==See Also==
*[[PS/2]]
*[["8042" PS/2 Controller]]
*[[PL050 PS/2 Controller | PL050 PS/2 Controller (ARM)]]
*[[PS/2 Mouse]]
===Forum Threads===
*[[Topic:9746|Keyboard input]]
*[[Topic:9761|Up or down press?]]
*[[Topic:9711|Change typerate]]
*[[Topic:9648|Converting the scancodes]]
*[[Topic:9448|Discussion about keyboard input in a GUI]]
*[[Topic:9590|Scroll-lock LED]]
*[[Topic:10153|Keyboard LEDs (asm source)]]
*[[Topic:10053|Keyboard LEDs (C source)]]
 
===External Links===
*[http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html Keyboard scancodes] - A complete reference on all scancodes you might encounter.
*[https://web.archive.org/web/20030621203107/http://www.microsoft.com/whdc/hwdev/tech/input/Scancode.mspx USB HID to PS/2 Translation Table] - Microsoft's table of scancodes and USB equivalents
*[https://web.archive.org/web/20190301075756/http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc Keyboard Scan Code Specification] - Microsoft's specification for scancodes
*[https://www.youtube.com/playlist?list=PLUZozxlhse-NUto5JeJ0EDXEUFloWBdAj PS/2 keyboard interface playlist] - A video playlist of building a PS/2 keyboard interface on bread boards, by Ben Eater.
 
==== Implementations ====
* [http://lxr.linux.no/#linux+v3.5.4/drivers/input/keyboard/atkbd.c Linux] (C,GPL)
* [https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/minix/drivers/hid/pckbd/pckbd.c Minix]
 
[[Category:Human Interface Device]]
[[Category:Common Devices]]
[[de:Keyboard Controller]]