热门问题
时间线
聊天
视角

鍵盤掃描碼

来自维基百科,自由的百科全书

Remove ads

鍵盤掃描碼(英語:scancodescan code)是電腦鍵盤計算機發送的一項數據,用於告知計算機哪些鍵被按下,這項數據對於絕大多數現代電腦鍵盤而言,遵循相同或幾乎相似的邏輯。

變種

以行、列映射定位位置(也就是二維數組形式)可以使鍵盤不必使用複雜控制芯片,因此在過去,使用軟件韌體翻譯掃描碼為文本字符比連接文本字符鍵盤更便宜。[1]這項成本差異已隨計算機芯片製造業發展而不再明顯。但目前,仍有許多種計算機在使用傳統的掃描碼以維護向下兼容

部分鍵盤標準中,每個按鍵的按下與鬆開的掃描碼不相同。此外,許多鍵盤標準(例如IBM PC兼容機)允許鍵盤本身發送「typematic」表示鍵盤按鍵被持續按住,鍵盤本身在重複生成掃描碼。

掃描碼集

总结
视角

PC兼容機

IBM PC兼容機鍵盤上的掃描碼是由鍵盤發送的1至3個字節為一組。大多數字符鍵具有單字節掃描碼,執行特殊功能的按鍵用2字節或3字節掃描碼,通常以下列字節開頭(十六進制): E0E1E2。此外,有幾個按鍵發送更長的掃描碼以有效方針一組按鍵,以便於操作某些軟件。

PS/2接口起的PC鍵盤支持最多三組掃描碼集。最常遇到的是「XT」掃描碼,它基於IBM PC XT及更早的計算機使用的83按鍵鍵盤。其大部分由單字節組成,低7位標識按鍵,

已隱藏部分未翻譯內容,歡迎參與翻譯
and the most significant bit is clear for a key press or set for a key release. Some additional keys have an E0 (or rarely, E1 or E2) prefix. These were initially assigned so that ignoring the E0 prefix (which is in the key-up range and thus would have no effect on an operating system that did not understand them) would produce reasonable results. For example the numeric keypad's Enter key produces a scancode of E0 1C, which corresponds to the regular Enter key's scancode of 1C.

The IBM 3270 PC introduced its own set of scancodes ("set 3"), with a different key numbering and where a key release is indicated by an F0 prefix. For 向下兼容, the 3270 PC translated these to XT (set 1) scancodes using an add-on card and a BIOS extension. This set is used by Linux by default when it detects a PS/2 keyboard that can properly support scan code set 3.[2]

The IBM PC AT introduced the "AT" ("set 2") scancodes. On the 84-key AT keyboard these were largely a subset of set 3, with some differences caused by the revised layout (for example, the position and scancodes of the function keys changed). Keys added since the PC AT often have different scancodes in set 2 and set 3, and in set 2 frequently have an E0 or E1 prefix. Again, key release is indicated by an F0 prefix.

For computers since the IBM PC AT, the keyboard controller on the 主板 translates AT (set 2) scancodes into XT (set 1) scancodes in so called translation mode.[3] This translation can be disabled in pass-through-mode, allowing the raw scancodes to be seen.[4] Therefore, whether a software developer will encounter AT scancodes or XT scancodes on a modern PC-compatible depends on how the keyboard is being accessed.

PS/2兼容鍵盤會被告知所要發送的是掃描碼集合1、2或3。

更多信息 按鍵, 集合1(IBM PC XT) ...
Remove ads

USB

USB鍵盤使用一組新的掃描碼集合,大部分在USB標準中指定。所有能識別USB鍵盤的計算機都能識別這組掃描碼。

參見

參考資料

外部連結

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads