I want write a program, and need to check is input method is running (Xojo’s KeyDown event always raised, so that I can’t confirm if user press a key is input Chinese Word or want to move position. )
[code]//Soft Declare Function gtk_im_multicontext_new Lib “gtk” () As Ptr
Declare Function gtk_im_multicontext_new lib “libgtk-x11-2.0.so” as Ptr
//Declare Function gtk_im_context_filter_keypress lib “libgtk-x11-2.0.so” (GtkIMContext as Ptr, GdkEventKey as Ptr) as Boolean
//Declare Function gtk_im_context_filter_keypress lib “libgtk-x11-2.0.so” () as Boolean
Soft Declare Function gtk_im_context_filter_keypress Lib “gtk” () as Boolean
'Dim im_context,EventKey As MemoryBlock
'im_context=gtk_im_multicontext_new()
'Label1.Text=CStr(gtk_im_context_filter_keypress(im_context,EventKey))
If gtk_im_context_filter_keypress()=True Then
Label1.Text=“True”
Else
Label1.Text=“False”
End If[/code]
I capture keys in a TextField(1) , and I want to move to next TextField(2) when user press ? .
But when user press down, he may choice a word in input method, also may really want to go next TextFiled…
Well then I’ll ask “does this work correctly in the code editor in the IDE on Linux ?”
If it does then you might want to NOT use a TextArea and consider using the TextInputCanvas.
If it does not then I’d guess we have an issue we need to fix in the text input canvas.
I think there’s no issue with everything, the keyboard is pressed surely, so that KeyDown/KeyUp raised is correct.
So it’s not only happen in Linux, also happen in Mac/Windows.
In my think, I want to use API to check if user in input method, so I found the “gtk-im-context-filter-keypress”.
Now I will try TextInputCanvas, if I make sense how it compiler…
I can say that in OS X the only way to make this work is to use the TextInputCanvas as you cannot handle input methods without it
I’m not certain that is true on Linux & Windows
Enter ‘make’ command at same Folder in Terminal.
If it show’s no gtk2 lib, run ‘sudo apt-get install libgtk2.0-dev’.
Then you will get a .so file as a plug-in.