Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mnemonics problem on Mac OS

 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a problem with the keyboard shortcuts (mnemonics) - when the cursor is in a text field after entering e.g. the database location, when I now click alt + the corresponding key for a button, the character assigned to this combination is first inserted to the text field and then the button's listener is called, resulting in an invalid field content.

I started development on linux first and only recently switched to Mac OS. If I remember correctly, I did not have this problem on linux.

Does anyone have the same problem and perhaps have an idea what I can do?

Thanks a lot in advance,
Sigrid
 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to include the isAltDown()==true in the keylistener. So this will ensure alt key is pressed with the letter key in order to activate the mnemonic.

You mentioned the Alt+key combo is first entered in the text field... try printing the text in the text field too. If this text includes the combo, you have another problem even if the trigger works.
 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tsang,

thanks for your answer.
Yes, unfortunately I have the problem of the "non-requested" character really ending up in the text field - so I really have an invalid entry in the text field!

(The listener itself works - first the character is entered and then immediately the listener is called...)

ciao,
Sigrid

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic