The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » LWUIT

Thread: TextField default key codes / mapping

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Nov 21, 2008 2:58 AM by: klemensz
klemensz

Posts: 31
TextField default key codes / mapping
Posted: Nov 20, 2008 4:47 AM
 
  Click to reply to this thread Reply

Hi,

Is there a way to override the mapping of key codes to characters/numbers, for example if I want to have German characters available as well? Looking at the source code I saw that DEFAULT_KEY_CODES is not accessible from outside the class or a subclass. Is there a special reason for that?

I see a possibility to accomplish what I need by overwriting the default input modes with my own input modes using addInputMode(). Is this the "correct" way? It might be easier if there was a getter for DEFAULT_KEY_CODES.

Thanks!

Shai Almog
Re: TextField default key codes / mapping
Posted: Nov 20, 2008 10:26 AM   in response to: klemensz
  Click to reply to this thread Reply

Hi,
there was an i18n post for text field in this list but I can't seem
to find it... Anyway you never need to change the code of text field,
use addInputMode(...) and related methods to do what you need.

> Hi,
>
> Is there a way to override the mapping of key codes to characters/
> numbers, for example if I want to have German characters available
> as well? Looking at the source code I saw that DEFAULT_KEY_CODES is
> not accessible from outside the class or a subclass. Is there a
> special reason for that?
>
> I see a possibility to accomplish what I need by overwriting the
> default input modes with my own input modes using addInputMode().
> Is this the "correct" way? It might be easier if there was a getter
> for DEFAULT_KEY_CODES.
>
> Thanks!
> [Message sent by forum member 'klemensz' (klemensz)]
>
> http://forums.java.net/jive/thread.jspa?messageID=317840
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]


klemensz

Posts: 31
Re: TextField default key codes / mapping
Posted: Nov 21, 2008 2:58 AM   in response to: Shai Almog
 
  Click to reply to this thread Reply

OK, I make my own Hashtables with the key mappings now and overwrite the default values with
TextField.addInputMode("ABC", upcase, false);
and
TextField.addInputMode("abc", lowcase, false);




 XML java.net RSS