pqrs-org / Karabiner-archived

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

Extreme end-user confusion due to keys being mapped inside System Preferences #821

Open fortran77 opened 7 years ago

fortran77 commented 7 years ago

As a new user of Karabiner, I enabled

   For PC Users => Use PC Style Copy Paste

which mapped Control+C to Command_L+C and so on. This mapping does not include Terminal.

I later went into

    => Keyboard => Shortcuts => App Shortcuts

then selected the Terminal application and tried to map the “Copy” menu item to Shift-Control-C. I was mystified to find that every time I typed Shift-Control-C, what appeared on the screen was Command_L+C. Likewise, when I tried to map Paste to Shift-Control-V, I got Command_L+V instead.

I spent quite a bit of time doing web searches to find out why this was happening and found nothing. I figured it was an OS X 10.10 bug.

An experienced user of Karabiner might expect this, in view of the “For PC Users” mapping that I had already enabled. But it never occurred to me that Karabiner's mapping would also be effective inside the Apple keyboard shortcuts window. Finally, after wasting several man-hours, I figured it out.

I think it's unlikely that a user would want to see previously-mapped keys appear in Apple's keyboard shortcut settings window. If feasible, no Karabiner mapping should occur within that window. It can only cause user confusion.

━━━━ Note.  is the Apple logo in Apple's private Unicode. Your web browser might show something else.

dunkarooftop commented 7 years ago

Karabiner is a very low level mod, that's why it will effect ANY WHERE on the system. For your modification adding ModifierFlag::NONE, would help.

You can find more info about it from the doc https://pqrs.org/osx/karabiner/xml.html.en search for "ModifierFlag::NONE"

    <item>
      <name>Use PC Style Copy/Paste</name>
      <appendix>(Control+C to Command_L+C)</appendix>
      <appendix>(Control+V to Command_L+V)</appendix>
      <appendix>(Control+X to Command_L+X)</appendix>
      <appendix></appendix>
      <appendix>{{ PC_STYLE_BINDINGS_IGNORE_APPS_DESCRIPTION }}</appendix>
      <identifier>private.my.remap.pc_style_copy_paste</identifier>
      <not>{{ PC_STYLE_BINDINGS_IGNORE_APPS }}</not>
      {{ PC_STYLE_BINDINGS_IGNORE_EXTRA }}
      <autogen>
        __KeyToKey__
        KeyCode::C, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL | ModifierFlag::NONE,
        KeyCode::C, ModifierFlag::COMMAND_L,
      </autogen>
      <autogen>
        __KeyToKey__
        KeyCode::V, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL | ModifierFlag::NONE,
        KeyCode::V, ModifierFlag::COMMAND_L,
      </autogen>
      <autogen>
        __KeyToKey__
        KeyCode::X, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL | ModifierFlag::NONE,
        KeyCode::X, ModifierFlag::COMMAND_L,
      </autogen>
    </item>

Above code I took from the Karabiner default code and added the ModifierFlag::NONE, and change the <identifier> so it won't conflct with the default one. Add it to your private.xml and enable it. Let me know if you have any questino.

dunkarooftop commented 7 years ago

Also do you want the PC style copy and paste work in "terminal" as well like every where else? if so remove line <not>{{ PC_STYLE_BINDINGS_IGNORE_APPS }}</not> and {{ PC_STYLE_BINDINGS_IGNORE_EXTRA }}

I recommend as a new user read thru the whole doc once to have an idea what Karabiner can do for you, there are many cool thing you can do

For example: __SimultaneousKeyPresses__ Press "F", "G" together for "copy" press "D", "G" together for "paste" (Those characters are on home row right hand side, easy to press)

or __DoublePressModifier__ Double tap "Right CMD" twice for "copy" Double tap "Left CMD" twice for "paste" (Karabiner is so low level that it can tell the difference between Left or Right Modifier)

or __KeyOverlaidModifier__ When "Right CMD" tap once act as "copy" and act as "Right CMD" when held with other keys When "Left CMD" tap once act as "paste" and act as "Left CMD" when held with other keys

is goes on and on, only limited by your imagination. Take a look at the doc and if you need any help feel free to post here, I can help you write out your mod if you have trouble. cheers