Are there keys that don't return ASCII codes?

  • Thread starter Thread starter JJBladester
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
JJBladester
Gold Member
Messages
281
Reaction score
2

Homework Statement



Give an example of a key that does not return an ASCII code.

The Attempt at a Solution



I looked at the extended ASCII table on www.ascii-code.com and found that there are several "control characters" which do not return a printable character. It seems pretty obvious that the escape key does not print a character, for example. However, it still returns code 1B (hex). I cannot imagine why there would be a key that would not return an ASCII code, and if so which key(s) that/they would be.
 
Physics news on Phys.org
JJBladester said:

Homework Statement



Give an example of a key that does not return an ASCII code.

The Attempt at a Solution



I looked at the extended ASCII table on www.ascii-code.com and found that there are several "control characters" which do not return a printable character. It seems pretty obvious that the escape key does not print a character, for example. However, it still returns code 1B (hex). I cannot imagine why there would be a key that would not return an ASCII code, and if so which key(s) that/they would be.

Think about the keys on your keyboard that modify the input or do something but don't actually produce characters on their own.
 
trollcast said:
Think about the keys on your keyboard that modify the input or do something but don't actually produce characters on their own.

I see where you are going with this (CTRL, ALT, Shift, etc.).

However, the escape key doesn't produce characters on the screen although it still has a hex code associated with it and it still can be read by certain interrupts like INT 16H. So, I am inclined to say it *does* return an ASCII code even though it is not displayed on the screen.
 
JJBladester said:
I see where you are going with this (CTRL, ALT, Shift, etc.).

However, the escape key doesn't produce characters on the screen although it still has a hex code associated with it and it still can be read by certain interrupts like INT 16H. So, I am inclined to say it *does* return an ASCII code even though it is not displayed on the screen.

The key / scan code is different to the ASCII code.

The key code tells the computer which key has been pressed, the os converts these into either values such as ascii codes or it will do something, eg. pressing the windows key will open the start menu, cap lock toggles the value the alphabet keys take, etc.

(The scan / key code tells which one of the keys on the keyboard has been pressed but not what it actually means so number 17 which is q on an english QWERTY keyboard would return a on a french AZERTY keyboard)
 
Thanks for clarifying about the scan codes vs. ASCII codes.