ibusManager: Add OSK completion mode

This mode changes the current IBus engine to ibus-typing-booster
under the rug (i.e. no changes in keyboard status menu) for any
XKB engine selected.

In order to make it useful for the currently selected language,
the typing-booster dictionary is changed to the current XKB
layout language. And since the OSK has its own emoji panel,
typing-boosters own emoji completion is disabled.

These changes only apply as long as the OSK panel is shown,
reverting to the original engine and typing-booster configuration
after it is hidden. This in theory also caters for users that
do have ibus-typing-booster enabled as an input source.

The final effect is text prediction for the language that is
being typed, according to the OSK layout, given that
ibus-typing-booster and the relevant hunspell dictionaries are
used.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2278>
This commit is contained in:
Carlos Garnacho
2022-04-22 13:28:02 +02:00
committed by Florian Müllner
parent 3c538fc7e2
commit b210b2de72
3 changed files with 79 additions and 1 deletions

View File

@ -315,4 +315,11 @@ var InputMethod = GObject.registerClass({
hasPreedit() {
return this._preeditVisible && this._preeditStr !== '' && this._preeditStr !== null;
}
handleVirtualKey(keyval) {
this._context.process_key_event_async(
keyval, 0, 0, -1, null, null);
this._context.process_key_event_async(
keyval, 0, IBus.ModifierType.RELEASE_MASK, -1, null, null);
}
});