Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to implement emacs style keybindings in all Qt programs (probably as a qt plugin)?

Gtk programs can have different keybinding themes by binding different keys to gtk signals, but afaik, qt programs cannot do that now.

Since Qt support plugins (as most of this kind of library do, and what I mean here is High Level Plugin or Qt Extension) and at least some of them (High Level Plugins) can be loaded automatically by all qt programs according to sth like ENV, is it possible to have global (Emacs or other style) keybindings (at least in all input area) using qt plugin? Or in an other word, does anyone know which kind of (High Level) plugin this should be?

My guess is a inputcontext plugin or a accessible(bridge) plugin. For input context plugin, I wonder if this can work with input method since afaik only one inputmethod backend can be enabled at one time. For accessible plugin, I haven't find out how to make it loaded automatically.

Thanks.

like image 442
yuyichao Avatar asked Dec 13 '11 03:12

yuyichao


1 Answers

You could install an event filter to intercept key events, and use that to convert them to other events.

I think you're using the word "plug-in" in a different sense to Qt. It has various specific plugins -- for image codecs, SQL drivers, etc -- but no general-purpose "do this to all widgets" mechanism. For that, you would have to catch all the creation-points of the top-level widgets in your application and add code to install the filter for each case.

like image 121
spraff Avatar answered Nov 19 '22 11:11

spraff