Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

KeyListener with Control key

 
Jack Lord
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to create a text input field with keyboard shortcuts to write non-standard characters: 'a' adds an a, 'ctrl+a' adds an a with an accent, 'alt+a' and 'ctrl+alt+a' add different accents etc. This works fine for the alt modifier but I get no response from the control key, or I press 'ctrl + a' and it selects the whole text. I'm guessing that the control key gets monopolised by some other component but I don't know how to disable it. I'm sure I've seen a post title on this very topic either here or elsewhere but I can't find it now. Thanks for any help!
Jack

My code:
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's move this to the Swing/AWT forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!