Geting keys ASCII numbers?

Non-platform specific questions.

Geting keys ASCII numbers?

Postby Novice » Fri Feb 10, 2006 6:39 pm

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
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Novice » Fri Feb 10, 2006 7:17 pm

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?
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby makslane » Fri Feb 10, 2006 9:29 pm

You need test if the shift or caps lock is pressed.
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Novice » Fri Feb 10, 2006 11:28 pm

:oops: Yup that would be it, didnt think it thru, i was in a hurry, sorry!
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron