• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to find the ASCII value of any key I press from Keyboard(specially Escape,F1,etc.)  RSS feed

 
Nikhil Aggarwal
Greenhorn
Posts: 12
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello guys,
I am trying to find the ASCII value of Escape in java language ....Please help me in solving this problem

Also tell me how to find the ASCII value of non-printable characters when I press any key like F1 , etc
 
Rob Spoor
Sheriff
Posts: 21117
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think all those keys have ASCII values. They have key codes, available through the KeyEvent constants, but that's not the same as ASCII values. ASCII implies characters, and the list is found at http://www.asciitable.com/. Note that F1-F12 are not on the list, but Escape is (with value 27, the same as the key code).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!