File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes keyTyped Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "keyTyped" Watch "keyTyped" New topic


Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I want to have a counter in the method keyTyped(KeyEvent e)
but I don't want to count 'backspace', 'space', 'escape', F1-F12, 'ctrl', 'shift' and 'tab'.
Is there anyway of doing this?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Of course you can just look the hard way for VK_BACK_SPACE, VK_SPACE, VK_ESCAPE etc and ignore those before you do your counting.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Don't get me started about those stupid light bulbs.
subject: keyTyped
It's not a secret anymore!