HID-Tastatur-Scanncodes
Lesezeit:
1 Min.
Von
- Tim Gerber
Scanncodes für Tasten auf der USB-Tastatur nach HID-Standard. Tastaturen senden diese Codes in HID-Descriptoren als gedrückt oder losgelassen. Die Codes werden unter anderem in der Library Keyboard.h verwendet, um über einen Arduino Tastaturanschläge an einen PC zu senden (siehe Artikel "Anschläge" in c't 8/16, S. 156). Für die Verwendung mit Befehlen wie Keyboard.press(TASTE), muss auf den Scancode noch 136 (dezimal) addiert werden. Eine Bibliothek mit erweiterungen für den Ziffernblock bieten wir zum Download.
| HID-Code | Hex | Taste (US-Tastatur) | HID-Code | Hex | Taste (US-Tastatur) | |
| 4 | 0x4 | A | 45 | 0x2D | _ - | |
| 5 | 0x5 | B | 46 | 0x2E | + = | |
| 6 | 0x6 | C | 47 | 0x2F | { [ | |
| 7 | 0x7 | D | 48 | 0x30 | } ] | |
| 8 | 0x8 | E | 49 | 0x31 | | \ | |
| 9 | 0x9 | F | 50 | 0x32 | (Int 2) | |
| 10 | 0xA | G | 51 | 0x33 | : ; | |
| 11 | 0xB | H | 52 | 0x34 | " , | |
| 12 | 0xC | I | 53 | 0x35 | ~ ` | |
| 13 | 0xD | J | 54 | 0x36 | < , | |
| 14 | 0xE | K | 55 | 0x37 | > . | |
| 15 | 0xF | L | 56 | 0x38 | ? / | |
| 16 | 0x10 | M | ||||
| 17 | 0x11 | N | 40 | 0x28 | Enter | |
| 18 | 0x12 | O | 41 | 0x29 | Escape | |
| 19 | 0x13 | P | 42 | 0x2A | RĂĽck | |
| 20 | 0x14 | Q | 43 | 0x2B | Tab | |
| 21 | 0x15 | R | 44 | 0x2C | Leertaste | |
| 22 | 0x16 | S | ||||
| 23 | 0x17 | T | 57 | 0x39 | Caps Lock | |
| 24 | 0x18 | U | 58 | 0x3A | F1 | |
| 25 | 0x19 | V | 59 | 0x3B | F2 | |
| 26 | 0x1A | W | 60 | 0x3C | F3 | |
| 27 | 0x1B | X | 61 | 0x3D | F4 | |
| 28 | 0x1C | Y | 62 | 0x3E | F5 | |
| 29 | 0x1D | Z | 63 | 0x3F | F6 | |
| 30 | 0x1E | ! 1 | 64 | 0x40 | F7 | |
| 31 | 0x1F | @ 2 | 65 | 0x41 | F8 | |
| 32 | 0x20 | # 3 | 66 | 0x42 | F9 | |
| 33 | 0x21 | $ 4 | 67 | 0x43 | F10 | |
| 34 | 0x22 | 5 % | 68 | 0x44 | F11 | |
| 35 | 0x23 | ^ 6 | 69 | 0x45 | F12 | |
| 36 | 0x24 | & 7 | 70 | 0x46 | Druck | |
| 37 | 0x25 | * 8 | 71 | 0x47 | Scroll Lock | |
| 38 | 0x26 | ( 9 | 72 | 0x48 | Pause | |
| 39 | 0x27 | ) 0 | 73 | 0x49 | EinfĂĽgen | |
| 74 | 0x4A | Home | ||||
| 83 | 0x53 | Ziffernblock | 75 | 0x4B | Seite hoch | |
| 84 | 0x54 | / ZB | 76 | 0x4C | Entfernen | |
| 85 | 0x55 | * ZB | 77 | 0x4D | Ende | |
| 86 | 0x56 | - ZB | 78 | 0x4E | Seite runter | |
| 87 | 0x57 | + ZB | 79 | 0x4F | Pfeil rechts | |
| 88 | 0x58 | Enter ZB | 80 | 0x50 | Pfeil links | |
| 89 | 0x59 | 1 Ende ZB | 81 | 0x51 | Pfeil runter | |
| 90 | 0x5A | 2 Pfeil runter ZB | 82 | 0x52 | Pfeil hoch | |
| 91 | 0x5B | 3 Seite runter ZB | ||||
| 92 | 0x5C | 4 Pfeil links ZB | 100 | 0x64 | (INT 1) | |
| 151 | 0x97 | 5 ZB | 101 | 0x65 | Windows MenĂĽ | |
| 94 | 0x5E | 6 Pfeil rechts ZB | 102 | 0x66 | unbelegt | |
| 95 | 0x5F | 7 Home ZB | 103 | 0x67 | unbelegt | |
| 96 | 0x60 | 8 Pfeil hoch ZB | 104 | 0x68 | F13 | |
| 97 | 0x61 | 9 Seite hoch ZB | 105 | 0x69 | F14 | |
| 98 | 0x62 | 0 EinfĂĽgen ZB | 106 | 0x6A | F15 | |
| 99 | 0x63 | . Löschen ZB | 107 | 0x6B | F16 | |
| 108 | 0x6C | F17 | ||||
| 109 | 0x6D | F18 | ||||
| 110 | 0x6E | F19 | ||||
| 111 | 0x6F | F20 | ||||
| 112 | 0x70 | F21 | ||||
| 113 | 0x71 | F22 | ||||
| 114 | 0x72 | F23 | ||||
| 115 | 0x73 | F24 | ||||
| 117 | 0x75 | Hilfe | ||||
| 122 | 0x7A | Rückgängig | ||||
| 123 | 0x7B | Ausschneiden | ||||
| 124 | 0x7C | Kopieren | ||||
| 125 | 0x7D | EinfĂĽgen | ||||
| 127 | 0x7F | Stumm | ||||
| 128 | 0x80 | Volumen hoch | ||||
| 129 | 0x81 | Volumen runter | ||||
| 135 | 0x87 | (INT3) | ||||
| 136 | 0x88 | katakana | ||||
| 137 | 0x89 | (INT4) | ||||
| 138 | 0x8A | knaji | ||||
| 139 | 0x8B | furigana |
(tig)