Customize shortcut keys for IBus 1.5

Currently ibus- is provided in Fedora 17 or later
If you use the old version, you could update the ibus packages below

# yum install --enablerepo=updates-testing ibus ibus-gnome3

Currently the default trigger key is “<Control>space”. Since I don’t port the engine hotkeys from ibus 1.4, the hotkey is common between engines. I know Hangul trigger key is important for Korean language so I added a workaround on Korean locale (ko_KR.UTF-8) in Fedora 17.
If you don’t change the default trigger key “<Control>space” and the current locale is ko_KR.UTF-8, ibus assigns two trigger key “Hangul” and “Alt_R”.
The dconf key “/desktop/ibus/general/hotkey/trigger-ko” is added newly.
If you customize the trigger key with ibus-setup, the workaround won’t be used.

I also try to summarize the customization of ibus trigger keys for ibus 1.5.
ibus-setup in Fedora 17 shows the following GUI.
Currently the GUI customization is not implemented yet so you need to type the trigger keys in “Enable or disable” entry box directly and push “Apply” button and ibus needs to be restarted.
The modifier keys (default is “< Control>) do not have the left or right status so the control modifier is expressed as “<Control>”. You also could use “<Shift>” and “<Alt>” and so on.
(ibus 1.5 uses gtk_accelerator_parse internally)
The accelerator keys without brackets (default is ‘space’) are expressed as the keysym. You could check it with ‘xev’ command. It means the accelerator keys have the left and right state.
If you wish to set multiple trigger keys, you could type them separated by semi colon “;”.
If you wish to set “<Alt>grave” and use both us and jp keyboard, it requires a considerable attention.
ibus uses XI2 keybinding (i.e. XIGrabKeycode()) and it needs keycodes instead of keysyms and then the order of XKB group layouts is important. The first keycode is used so you need to set the order of us, jp because jp keyboard has “Zenkaku_Hankaku” on the position of “grave” and the jp “Zenkaku_Hankaku” and us “grave” have the same keycode.
So if you set the order of jp, us, the “<Alt>grave” won’t be enabled.
The order can be decided by the ‘gnome-control-center region’ on GNOME desktop:
After set the order of XKB layouts, you could confirm it reflects the current order by ‘ibus-xkb’ command. (Maybe you need to stop ibus)

 % /usr/libexec/ibus-xkb --get
layout: us,jp
variant: ,
option: ctrl:swapcaps,grp:alt_shift_toggle,compose:rctrl

And then “<Alt>grave” could switch ibus engines.
(When you set the order of jp, us, “<Alt>Zenkaku_Hankaku; <Alt>grave” could resolve the problem at the moment. Probably I need to know if XI2 has no plan to support keysyms.)

About fujiwara

I'm an open-sourced desktop i18n developer.
This entry was posted in IBus and tagged , , , . Bookmark the permalink.

7 Responses to Customize shortcut keys for IBus 1.5

  1. Quentin says:

    I am using version 1.4.99 on Fedora, and cannot find the “Share the same input method across all applications” in the Advanced tab. I want to disable this behavior while it appears to be the default.

  2. fujiwara says:

    Unfortunately it would be no plan.
    Now ibus switches input method engines and xkb keyboard engines and we need the global XKB status. GNOME upsteam asks not to have the local input status and I agreed with it.
    Maybe I think the current behavior would be compatible with Mac OS X.

  3. Mac OS X does allow user to select whether input source is global and the default is not global, check the screenshot in comment 3:

  4. Manatee says:

    Hello, thank you for your post!
    I’m using Kubuntu 14. I would like to change the default space shortcut to be “Alt-Shift” but it doesn’t seem to recognize either shift, or alt and so on. Which format does it recognize? If I can’t change it in the setting, is there a way to do this through the terminal?

    • fujiwara says:

      Now the default trigger key is “<Super>space” in the latest ibus 1.5.
      The trigger keys requires modfiers keys + keysyms.
      If you try to put “<Alt><Shift>”, it would not be accepted as trigger keys since the both and is modifiers key and cannot configure on GUI.
      To put “<Alt>Shift_L”, you could set the value with gsettings command line directly.

      % ibus read-config | grep triggers
      triggers: [‘<Super>space’]
      % gsettings set org.freedesktop.ibus.general.hotkey triggers “[‘<Alt>Shift_L’]”
      % ibus read-config | grep triggers
      triggers: [‘<Alt>Shift_L’]

  5. Manatee says:

    Oops, sorry, part of my text got formatted. What I meant was:
    I would like to change the defaulr “space” shortcut to be “Alt-Shift” but it doesn’t seem to recognize either “shift”, “” or “alt” and so on

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s