I need scan codes for arrows (right,left,down,up). I am making software in Assembler and I need to know the hex values for the scan codes of the keyboard arrows.
A scancode (or scan code) is the data that most computer keyboards send to a computer to report which keys have been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard.
The arrows are known as cursor control keys (the cursor is the flashing bar on the computer screen that shows your current position). Many keyboards also have a separate pad for these keys (look for a set of arrow keys).
The arrow keys are used in many applications to do different things such as: Moving text cursor to the right, left, previous line and next line.
Those are the character codes for arrow characters in the lower portion of the ASCII codepage:
And the scan codes for the arrow keys are:
Notice the different order.
The scan codes are returned, for example, from the BIOS interrupt 16h. In general, scan codes don't correspond to ASCII characters, because some keys legitimately don't represent a character - like Shift, or Caps Lock, or the arrow keys. Those don't produce a character in the input stream, but they do have scan codes, and programs are capable of retrieving those.
Even the alphanumeric keys that do correspond to characters may represent different characters at different time, depending on Shift and on the chosen keyboard layout.
Whatever Linux thinks, neither the keyboard nor the screen are byte streams.
Great can obtain scan codes in linux with:
sudo showkey -s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With