Can all keys be represented as a single char in c++? -
I have searched around and can not find a way to represent arrow keys, is it also in C ++ possible? I hope this will be like \ t or \ n for the tab and the new line respectively. Whenever I search for the characters of Exodus, there are only five or six famous characters.
No short answer.
The long answer is that the standard ANSI character set (decimal 1 to decimal 31, inclusive) has many control letters, of which there are control codes for linefeed, cart back, end of file, and on this much. Some are generally defined as arrows and escape keys, but only for compatibility with terminals.
The standard PC keyboard sends a 2- or 3-byte control code that represents the key to be pressed, in what state it is, that the control / alt / shift key is pressed, and some Other Things To see how you want to handle them, you will want to see the "key code". They are handled differently between the operating system and the base library you use, and their meaning is different depending on the operating system's configured keyboard layout (characters can not be found in the ANSI character set) .
Comments
Post a Comment