pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.63k stars 836 forks source link

Using Karabiner-Elements to switch between input methods #1092

Closed MagisDing closed 6 years ago

MagisDing commented 6 years ago

I was told to used private.xml to switch to specific input method directly:

<vkchangeinputsourcedef> 
    <name>KeyCode::VK_CHANGE_INPUTSOURCE_BAIDUIM_PINYIN</name>  
    <languagecode>zh-Hans</languagecode>  
    <inputsourceid_equal>com.baidu.inputmethod.BaiduIM.pinyin</inputsourceid_equal>  
    <inputmodeid_equal>com.baidu.inputmethod.pinyin</inputmodeid_equal> 
  </vkchangeinputsourcedef>  
  <item> 
    <name>Change input source to Baidu Pinyin by right command key x 2</name>  
    <identifier>private.change_input_source_to_baidu_pinyin</identifier>  
    <autogen>
        __DoublePressModifier__ KeyCode::COMMAND_R, KeyCode::COMMAND_R,
        KeyCode::VK_CHANGE_INPUTSOURCE_BAIDUIM_PINYIN
    </autogen> 
  </item>  

  <vkchangeinputsourcedef> 
    <name>KeyCode::VK_CHANGE_INPUTSOURCE_APPLE_ABC</name>  
    <languagecode>en</languagecode>  
    <inputsourceid_equal>com.apple.keylayout.ABC</inputsourceid_equal> 
  </vkchangeinputsourcedef>  
  <item> 
    <name>Change input source to Apple ABC by right shift key x 2</name>  
    <identifier>private.change_input_source_to_apple_abc</identifier>  
    <autogen>
        __DoublePressModifier__ KeyCode::SHIFT_R, KeyCode::SHIFT_R, 
        KeyCode::VK_CHANGE_INPUTSOURCE_APPLE_ABC
    </autogen> 
  </item>

Does it work in nowadays version? Or is there a way to bind a key combination to another key combination(like bind a double stroke to ctrl+space)?

jerryjune commented 6 years ago

see this page issues 19

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.