pqrs-org / Karabiner-archived

Karabiner (KeyRemap4MacBook) is a powerful utility for keyboard customization.
https://pqrs.org/osx/karabiner/
The Unlicense
3.82k stars 309 forks source link

Make Emacs Mode Control+AE work for only Korean Input #799

Open excetara2 opened 7 years ago

excetara2 commented 7 years ago

I tried to make this work properly but I couldn't figure it out.

First I wanted to enable contrl+ae but just for Korean input. However, I couldn't find a similar example because it doesn't seem to do this in the readme under the Korean section. Or was I just missing something?

Second, I had tried the below but figured it doesn't recognize Korean characters as keys so this clearly didn't work :

 <item>
      <name>Control+AE to Command+Left/Right</name>
      <identifier>option.emacsmode_hanja_controlAE</identifier>
      <not>{{EMACS_MODE_IGNORE_APPS}}</not>
      <modifier_not>
        ModifierFlag::COMMAND_L, ModifierFlag::COMMAND_R,
        ModifierFlag::OPTION_L,  ModifierFlag::OPTION_R,
      </modifier_not>
      <autogen>
        __KeyToKey__
        KeyCode::ㅁ, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL,
        KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L,
      </autogen>
      <autogen>
        __KeyToKey__
        KeyCode::ㄷ, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL,
        KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
      </autogen>
    </item>
excetara2 commented 7 years ago

Nevermind, I figured it out:

      <inputsource_only>KOREAN</inputsource_only>
excetara2 commented 7 years ago

I assume if you want Control+PNBF to <not>{{EMACS_MODE_IGNORE_APPS}}</not> for all inputs except when <inputsource_only>KOREAN</inputsource_only> is on then it applies in all applications inlcuding the EMACS_MODE_IGNORE_APPS.

I have to make two seperate bindings in this case? Or is there a way to apply this within the same binding using some sort of if statement?