Skip to content

What is the shortcut for changing the input mode on Linux? #395

Closed

Description

@HubKing

There is similar post at #114 (The keyboard shortcuts to change input mode are not working). I would have liked to add my question there, but the last post was "Please file a different bug rather than reusing a closed bug.", so I create a new thread.

I am using Mozc with English (US) layout keyboard and MS-IME keymap.

On the latest version of Linux Mint (Mozc 2.17.2116.102), pressing [Alt + ~] did nothing. I tried it on Kubuntu 16.04.1, it did nothing there either (by default [Alt + ~] had been assigned to some system action, but I removed that shortcut).

Someone has asked the same question on Ask Ubutu http://askubuntu.com/questions/561486/how-do-i-switch-input-modes-in-mozc-without-going-to-the-ibus-menu (How do I switch input modes in mozc without going to the IBus menu?) The person who answered the question wrote he could not get [Alt + ~] working.

So, if [Alt + ~] is not the shortcut for changing input mode, what is? I could not find any documentation/help/manual...

Activity

  1. SilverEzhik commented on Nov 12, 2016

    @SilverEzhik

    I can't get Alt+~ working either. In fact, in the shortcut editor I can't get any shortcuts with Alt or Super keys working.

    I settled with adding the Ctrl+~ shortcut to the "Activate IME" command for "Direct input" in the Mozc keymap editor. This took a reboot to get working.

  2. HubKing commented on Nov 13, 2016

    @HubKing
    Author

    Is there any way to set the Hiragana mode by default? I only use the Hiragana mode, so if it starts in the Hiragana mode, I would not need to worry about this key in the first place. Other modules such as "ibus-Hangul" has an option for starting with Hangul mode by default.

  3. yukawa commented on Nov 14, 2016

    @yukawa
    Collaborator

    On the latest version of Linux Mint (Mozc 2.17.2116.102), pressing [Alt + ~] did nothing. I tried it on Kubuntu 16.04.1, it did nothing there either (by default [Alt + ~] had been assigned to some system action, but I removed that shortcut).

    Your understanding is correct. Alt + ~ currently works only on Windows because unlike other key bindings defined in src/data/keymap/ms-ime.tsv Alt + ~ is hard-coded in src/win32/tip/tip_text_service.cc as follows.

        kTipPreservedKey_Kanji,
        { VK_OEM_3, TF_MOD_ALT },
        VK_OEM_3,
        &kTipKeyTilde[0],
        arraysize(kTipKeyTilde) - 1
    

    I can't get Alt+~ working either. In fact, in the shortcut editor I can't get any shortcuts with Alt or Super keys working.

    This is also working as intended because we thought keys like Alt and Super should be reserved for system-level key bindings. In some platforms, we may or may not be able to use those keys in IMEs, but in general we do not want to encourage users to rely on those modifiers in Mozc.

    Is there any way to set the Hiragana mode by default?

    Technically speaking, yes, there is a way to do that. See #381 and #201 for details.

  4. SilverEzhik commented on Nov 14, 2016

    @SilverEzhik

    This is also working as intended because we thought keys like Alt and Super should be reserved for system-level key bindings. In some platforms, we may or may not be able to use those keys in IMEs, but in general we do not want to encourage users to rely on those modifiers in Mozc.

    Is there something preventing this from being done on a per-platform basis? In GNOME, KDE, and Unity, I have no trouble assigning a shortcut to Alt and Super keys. I understand that Mozc is a separate component, but from the perspective of somebody who enabled it by simply adding Japanese language support from GNOME settings, I don't really see the reasoning behind this artificial limitation - it creates inconsistency between the desktop environment of the user and the Mozc component, which can easily be perceived as a part of the shipping OS just like the MS IME would be on Windows, and also prevents people from using shortcuts they might already be familiar with on Windows.

    For now, a workaround for this I can think of is creating a custom shortcut for Alt+~ with either built-in DE tools and xdotool, or AutoKey, which would in turn press a different combination that Mozc accepts.

  5. yukawa commented on Nov 14, 2016

    @yukawa
    Collaborator

    Is there something preventing this from being done on a per-platform basis?

    Just to be clear, our current approach on this is to not support Alt as a modifier in Mozc at all. The fact that src/win32/tip/tip_text_service.cc does that is a historical thing because Windows OS had done this in the OS layer when we use IMM32 API, which is the legacy IME API on Windows. Any other key combination that requires Alt as a key modifier is not supported even on Mozc for Windows. I'd also want to point out that MS-IME on Windows indeed does not allow Alt to be used in its custom key binding.
    ms-ime_keybinding_editor_on_windows10

    I don't really see the reasoning behind this artificial limitation - it creates inconsistency between the desktop environment of the user and the Mozc component

    Again, the reasoning behind not supporting Alt in the keymap editor is exactly for the consistency. If we had allowed arbitrary key combinations with Alt and any other key, such a shortcut would never work on Windows 8 and later environment because such combinations need to be registered to the OS like src/win32/tip/tip_text_service.cc, which requires non-trivial changes.

  6. yukawa commented on Nov 14, 2016

    @yukawa
    Collaborator

    I can't get Alt+~ working either. In fact, in the shortcut editor I can't get any shortcuts with Alt or Super keys working.

    If you really really want to set such a key map, one possible way is to use Import from file... in the keymap editor.
    import_custom_keymap

    The text form of the keymap settings is just a TSV file, where you can actually use Alt as a valid keyword as follows as of Mozc 2.19.2623.102.

    DirectInput Alt `   IMEOn
    

    Here is a sample keymap file with the above entry.

    Keep in mind that in some platforms (e.g. Mozc client for Windows 8 and later) Alt may not work even if it is specified in the custom keymap.

    Note also that being able to use Alt keyword when importing from a keymap text file is completely unofficial and undocumented. We may remove this feature without any notice in a future version of Mozc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions