热门问题
时间线
聊天
视角

鍵盤掃描碼

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

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 content...
Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads