wxWidgets change keyboard input language - keyboard

is there a function / class in wxwidgets that allows me to find out what keyboard layouts are installed and then change them?
I looked through the documentation and came across wxLanguage and wxKeyboardstate, but they don'T seem to be the answer.

No. This is done using the standard system-global methods and wxWidgets doesn't provide access to it. FWIW wxLanguage is only used to select the locale to use and you can also retrieve the default user language, but not the keyboard layout.

Related

Is there a way to get Keyboard change reflect on Appimage?

I am using ibus keyboard layout and I can change the language globally, However this change is not reflected on Appimages (I am using Inkscape). Is there a solution to this problem or are Appimages supposed to be like this?
This needs to be addressed by the Inskape AppImage authors. They are the ones who decide whether the bundle will use the system settings or a fixed language/keyboard preferences.

Disable the interactive-search - user side

I got accustomed to then I write file name in Save dialog in Windows PC, it writes into file name label. In linux I must focus on label, and then write. It's annoying, but I can't find how to disable quick search. I see source, GTK documentation, asking questions to developers, but no help. There is this mice hidden? GTK2-3, no matter.
In the answers on this site I see recomendations for developers, not users. I want recompile GTK, or write the key in .gtkrc-2.0/3.0 to disable this functionality.
I found, that GTK developers is very hard of hearing, and don't like adding configurable options.
This "feature" is called typeahead and hardcoded in GTK libs, so no config or build options, just fixing code needed. It's a pity...
https://www.reddit.com/r/archlinux/comments/33x4wk/gnomegtk_316_file_chooser_typeahead/
But I find filename and strings to modify:
/gtk+-3.22.7/gtk/gtkfilechooserwidget.c b/gtk+-3.22.7/gtk/gtkfilechooserwidget.c
gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->browse_files_tree_view), -1);
/gtk+-3.22.7/gtk/ui/gtkfilechooserwidget.ui b/gtk+-3.22.7/gtk/ui/gtkfilechooserwidget.ui
0
Now need find source of GTK, because there is no option to disable this behavior...

How do you package a keyboard layout for Windows 8?

I've been searching for a way to do this. I use a slightly modified Colemak keyboard layout and I can't figure out how to add it as a supported input method in the new language selection in Windows 8. The installer that the Colemak guys distribute sort of works; you can choose the layout after installing it, but it forces the EN-us language, and can't be chosen for other languages.
If anyone knows how to do this properly, I'm sure the Colemak guys would appreciate hearing about it, and it would let me make the modifications I want to.
I don't know if this is the exact issue but there is a problem with MSKLC-generated layouts in Win8 (DP&CP).
You can choose the language if you make your custom keyboard layout with MSKLC: in the "Properties" part, or, if it does not work (though I'm sure it does), you can edit the .klc file manually.
Build it and setup with the executable. You are done.

Linux, change text field behavior

I have an idea to write a program that modifies the behavior of text fields on Linux. What I want is that the program will automatically change the text entry language according to the textfield's text direction in all the system. For example, if I have English and Hebrew languages installed, and I click on a textfield in some software that normally outputs the text from right to left, than the program will automatically change the text entry language to Hebrew. If I click on a text field that outputs text from left to right, the program will switch the language to English.
I don't know much about system or UI programming on Linux, ( More experienced on Windows ) and I don't know where to start. Is there a way to register 'hooks' on GUI elements on Gnome and KDE? Maybe I should add this to Gnome and KDE's code?
I'd appreciate any hints as to how to start.
Many thanks,
Oded.
First some caveats:
Normally text field alignment for GUI windowing toolkits is either explicitly set by the program or is set based on the detected system locale (in Qt and GTK at least) either in relevant Text Object QLineEdit in Qt or GtkEntry in GTK or in the higher level Layout Object that contains them.
That said in order to implement the functionality at least for your own programs, you will need to identify a few things
GTK or Qt or both ? If you are implementing at base level (i.e not just bindings), then this also means C or C++ or both ?
GTK 2 or GTK 3, QT 3 or QT4 ?
Which text widgets on each GUI toolkit to you want to override ? Just the two I mentioned I above or any or all of the possible text widgets in either library ?
Do you want your behavior to work regardless of the locale set ? E.g If you have LTR locale set do you want right aligned text widgets to switch input method ?
What method of switching input method do you want to use ? SCIM, XIM, ibus or just immodule (in both its GTK and Qt forms) ? Do these input methods support being programatically changed ??
What happens if a user has 2 or more LTR languages installed or 2 more RTL languages installed ? Do they get to pick which language ? Is there current locale setting respected ?
Assuming you want to go down the immodule path
See the following resources for Qt
How to support input method in KDE/Qt application.
QInputMethodEvent Class Reference. You will want to implement this event, and the get Text widget's alignment using an alignment accessor, then set the Input Method based on alignment.
See the following resources for GTK
GtkIMContext
GtkIMContextSimple
GtkIMMulticontext
The general method is the same.
Implement the event handler for when text is typed into the widget but before it is displayed in the widget.
Switch the input method based on the widget's alignment property
Resources on learning GTK
GTK 3 Reference Manual
GTK 2 Reference Manual
Gnome Developer Centre
Resources on learning QT
QT Reference Documentation
Qt4 tutorial for absolute beginners
The Qt4 tutorial
From your comment, it seems you would be instead be writing your own InputMethod mechanism or modifying an existing one.
In order to have it loaded by default in Gnome and KDE programs not difficult to do, just set your input method based on locale association. The difficult part is having the InputMethod aware of location it is being typed into. Normally the InputMethod isn't aware of the calling application, let alone the GUI framework it is written in.
Resources on Input Methods
List of input methods for UNIX platforms
Linux input method framework brief summary
ibus
uim
scim

GTK+ underscores - physically painful

Programming with GTK+ is annoying and physically painful because of the sheer amount of reaching out for the "_" key. For anyone with actual GTK+ experience, have you found a work around for this?. The platform is linux based.
Use an editor with code completion support. Eclipse, Vim, and Emacs can all do this.
http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard
Either use autocompletion, or reassign your underscore key to another, more reachable one.
If you just wish to use the api of gtk+ - then try vala, pygtk or binding in language of your preference.
If you wish to modify core then use autocomplete,macros.

Resources