Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Change keyboard input language
Change keyboard input language [message #524249] Wed, 31 March 2010 10:30 Go to next message
HC is currently offline HCFriend
Messages: 20
Registered: July 2009
Junior Member
Hello!

I'd like to know if it's possible to select a specific language input from the ones installed in the system (windows) to apply to a StyledText.

What I want to do is to change the system input language (Japanese, Bulgarian, English, Portuguese, ...) when the user selects the StyledText.

I've been looking for a simple JAVA call to do this, but it doesn't seem to exist...
The only thing I've found was java.awt.im.InputContext which doesn't apply to SWT Rolling Eyes


Thanks!
Re: Change keyboard input language [message #524379 is a reply to message #524249] Wed, 31 March 2010 17:39 Go to previous messageGo to next message
HC is currently offline HCFriend
Messages: 20
Registered: July 2009
Junior Member
I managed to change system language by calling the static method
OS.ActivateKeyboardLayout(int hkl, int Flags) 


where hkl is one of the resulting IDs returned by calling
OS.GetKeyboardLayoutList (int nBuff, int [] lpList)
.


My problem now is that I don't know the description of the Language I'm selecting.

For instance, the ID -257293310 corresponds to Bulgarian, but I don't have any information about that. I just know it because the value in windows language bar changed...


Any ideas?!?

Thanks!
Re: Change keyboard input language [message #524409 is a reply to message #524379] Wed, 31 March 2010 20:15 Go to previous message
Ralf Ebert is currently offline Ralf EbertFriend
Messages: 168
Registered: July 2009
Senior Member
Hi,

> I managed to change system language by calling the static method
> OS.ActivateKeyboardLayout(int hkl, int Flags)
> where hkl is one of the resulting IDs returned by calling
> OS.GetKeyboardLayoutList (int nBuff, int [] lpList).

please note that this is internal, platform-specific Windows API. You can read about how
this is supposed to work at:
http://msdn.microsoft.com/en-us/library/ms646289%28VS.85%29. aspx

You can try to use "Find references" to that method (Ctrl + Shift + G) to find SWT methods
that use this call. But I doubt there is cross-platform SWT API to switch the keyboard
layout for single controls / shells in SWT.

Greetings,

Ralf


--
http://www.ralfebert.de/blog/
http://twitter.com/ralfebert/
Previous Topic:Treeviewer Scrollbar vanishing act
Next Topic:Click/Drill through to windows/applications underneath SWT window
Goto Forum:
  


Current Time: Sun Dec 08 07:05:58 GMT 2024

Powered by FUDForum. Page generated in 0.03210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top