• 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

Mnemonics problem on Mac OS

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic