ABSTRACT

The getAscii( ) method returns a numerical reference to letter that was typed. If “A” is pressed, Key.getAscii( ) returns 97 – the ASCII number which represents the lowercase letter “a”. But if SHIFT-“A” is pressed, Key.getAscii( ) returns 65, the ASCII code for the uppercase letter “A”.

If an application needs to differentiate between uppercase and lowercase, then the getAscii( ) method is required. But many applications just need to know which key is pressed, regardless of case. This is when getCode( ) comes in handy.