

InterviewSolution
1. |
Solve : ASCII for Alt key? |
Answer» Keys have ASCII values, eg, Esc is ASCII 27, Enter is ASCII 13 Keys have ASCII valuesAnd I'm afraid that's where you'd be wrong. Dusty's right; scan codes are not the same as ASCII codes. Shift, ctrl, alt etc do not have corresponding ASCII codes; to test for them you'd need to use a keyboard interface library.Oops. Everybody jumps on the NEWBIE... If he can interface the keyboard, if the 3rd bit is set to 00, the keyboard will return the scancode set that it is using. If it is not as expected, he would have to create a lookup table to RETRIEVE the proper scancode. Not exactly the simplest of tasks. The newer 120+ key keyboards have additional scancodes for the extra keys; however, the main keys must be backward compatable with the 101 enhanced keyboard. This is not my forte! I'm gonna quit while I still can. Maybe I over-simplified the use of scancodes, it's quite a COMPLEX subject for a new-comer and some of us older-comers. I found this to be a good reference. The entire site starting here is good reading for a wet Sunday afternoon Good luck |
|