10

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.

2 Answers 2

1

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.

3
  • What about the loading part then? (I didn't find any document on how Qt dicide to load these plugins~~~)
    – yuyichao
    Dec 13, 2011 at 12:05
  • Although thoes extensions ARE loaded in most qt programs(that has input box) but not in skype. Any reason for that?
    – yuyichao
    Dec 13, 2011 at 12:42
  • It is what I mean by "plug-in". (and my question is just if there is a type of plugin that I can use.) I think probably accessibility or inputcotext plugins can help, but I don't know how/when these plugins are loaded. Actually I am pretty sure a inputcontext plugin can do this (for input context only) if u r not using any input method. (btw, for skype it's probably because skype doesn't use standard qt element~~)
    – yuyichao
    Dec 13, 2011 at 20:23
0

I somehow solve the problem (along with this one) using xkb, i.e. redirect C-npfbae to proper keys, although I haven't made C-d redirection compatible with terminal EOF.

I still think the problem (in Qt) can be solved with qtaccessible plugins but I haven't find out how to make that work.

1
  • Hm, no, not a very good workaround… E.g. in the Emacs itself I am using «C-S-f» to move selection one char forward. But the arrows are free now, so I bound to «S-AnArrow» a movement between splitscreens. If I'd bound «C-S-f» to the «S-→» for a system level, it'd break everything.
    – Hi-Angel
    Jul 14, 2015 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.