Are there keys that don't return ASCII codes?

  • Thread starter JJBladester
  • Start date
In summary: From what I understand, the original question was about keys that do not return an ASCII code at all, and the escape key was given as an example. However, it seems that even though the escape key does not produce a character on the screen, it still does have a hex code associated with it and can be read by certain interrupts. Therefore, it can be argued that it does return an ASCII code in a sense. In summary, the question of a key that does not return an ASCII code may not have a clear answer as even the escape key, which was given as an example, still has a hex code associated with it and can be read by certain interrupts.
  • #1
JJBladester
Gold Member
286
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
  • #2
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.
 
  • #3
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.
 
  • #4
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)
 
  • #5
Thanks for clarifying about the scan codes vs. ASCII codes.
 

1. What is an ASCII code?

An ASCII code is a standardized numerical representation of a character or symbol used in digital communications. It consists of a 7-bit code that can represent up to 128 characters, including letters, numbers, punctuation marks, and control characters.

2. Are all keys on a keyboard assigned an ASCII code?

Yes, all keys on a standard keyboard are assigned an ASCII code. This allows for consistent communication between devices and ensures that the correct characters are displayed.

3. Are there any keys that do not have corresponding ASCII codes?

Yes, there are some keys that do not have corresponding ASCII codes. These include function keys, arrow keys, and modifier keys like shift and control. These keys are used for special functions and are not meant for displaying characters.

4. Can a key have multiple ASCII codes?

No, a key can only have one ASCII code. However, some keys may have different codes depending on the context or the type of keyboard being used.

5. Are there any alternative coding systems besides ASCII?

Yes, there are many alternative coding systems besides ASCII, such as Unicode and EBCDIC. These systems use a larger number of bits to represent a wider range of characters and symbols, making them more suitable for international communication and modern computing needs.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
11
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Programming and Computer Science
Replies
13
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
  • Programming and Computer Science
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
265
Back
Top