Page 1 of 1

Geting keys ASCII numbers?

PostPosted: Fri Feb 10, 2006 6:39 pm
by Novice
What is the easiest way to get a number from the ASCII table when you press a key, for ex. i press A and get 65 in my varibale, i press B and get 66... TIA

PostPosted: Fri Feb 10, 2006 7:17 pm
by Novice
Ok i figured it out.Sorry bout that.:oops:
Code: Select all
int lastKey = getLastKey();

But now my problem is that it dosent recognise letters when shift is pressed, so if i press "a" or "A" either way i get 97 (a). How can i make it recognise capital letters?

PostPosted: Fri Feb 10, 2006 9:29 pm
by makslane
You need test if the shift or caps lock is pressed.

PostPosted: Fri Feb 10, 2006 11:28 pm
by Novice
:oops: Yup that would be it, didnt think it thru, i was in a hurry, sorry!