[SailfishDevel] How to access the text edit widget from an input method?

Pekka Vuorela pekka.vuorela at jolla.com
Tue Feb 20 10:33:33 UTC 2018


On Mon, 2018-02-19 at 17:52 +0200, Camil Băncioiu wrote:
> I'm editing the QML files that belong to the virtual keyboard to add
> some extra functionality. Would it be possible to somehow to change
> the font of the widget that is receiving the keyboard input? I'm
> currently editing KeyboardBase.qml and InputHandler.qml from
> /usr/share/maliit/plugin/com/jolla (keeping them under version
> control for safety).
> 
> My final goal would be to press a special key on the modified
> keyboard which would result in changing the font in the text editing
> widget that receives the keyboard input, no matter what app / window
> it belongs to. Is this possible?

Doesn't sound feasible. Keyboard and application are different
processes and keyboard is able to only request text actions.
QInputMethod, which the text component receives, doesn't have support
for changing font except some formatting options for preedit (= active,
underlined word).

(Or ok, you could create a custom input context plugin with special ipc
for this, have that loaded into qt apps instead of current one and
there mess with font property of focused QObject. Not recommending
going that far :))


More information about the Devel mailing list