• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Escape key

 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any reason why I can't see my ESC key from the keyPressed method of a LeyListener? The ESC key works fine but if I look at my KeyEvent object passed in, there's nothing there.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
First I am not very sure of what u really want . How ever out of my undestanding the things, I can say escape key doesnt print anything on the screen That is why u cannot see anything. However if u wanna trap that key, the ascii code for it is 27
and can implement the logic tht u want to happen on click of that event

------------------
Try and Try Till u succeed
Sandeep Jain
 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got what I needed by using the keyReleased() method and checking for KeyEvent.VK_ESCAPE. The ESC key only invokes the keyTyped() and keyReleased() methods but even with the keyTyped() method, it won't recognize ascii code 27. It doesn't seem very consistent but at least my thing is working.
Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic