stdout and key press
Posted
by Jack
on Super User
See other posts from Super User
or by Jack
Published on 2010-03-09T10:24:05Z
Indexed on
2010/03/09
10:38 UTC
Read the original article
Hit count: 299
Hi, when in console, if I press a key, some interrupt controller sends code of that key to CPU, which looks into some table and than represent that keypress by printing some charracter to stdout. But, is keyboard sending an ASCII code of that key, or just some standardised code? Since there is so many languages and extra characters, OS must further translate its code into some character according to user selected scheme, I guess. I ask, becouse I am from Czech Republic, and we use some characters that do not exists in standart ASCII code. So I was thinking, if I enter this character into a console, and then print it, lets say in C++ using cin and cout, and I have set locale to Czech, stdin must actually send some non-ASCII code of the character I pressed to input stream. Am I right?
© Super User or respective owner