blink icon indicating copy to clipboard operation
blink copied to clipboard

Option key on magic keyboard sends accent characters even when ignoreAccents is true

Open adrusi opened this issue 2 years ago • 2 comments

Checklist

Configuration

.blink/kb.json
{
  "cursor" : {
    "shiftLoc" : 0,
    "controlLoc" : 0,
    "optionLoc" : 0,
    "keys" : [
      "91:1"
    ],
    "commandLoc" : 0,
    "action" : {
      "type" : "none"
    }
  },
  "option" : {
    "right" : {
      "code" : {
        "code" : "AltRight",
        "id" : "18:2",
        "key" : "Alt",
        "keyCode" : 18
      },
      "down" : "",
      "up" : "",
      "ignoreAccents" : true,
      "mod" : "Escape"
    },
    "same" : true,
    "left" : {
      "code" : {
        "code" : "AltLeft",
        "id" : "18:1",
        "key" : "Alt",
        "keyCode" : 18
      },
      "down" : "",
      "up" : "",
      "ignoreAccents" : true,
      "mod" : "Escape"
    }
  },
  "shortcuts" : [
    {
      "input" : "c",
      "action" : {
        "type" : "command",
        "value" : "clipboardCopy"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "v",
      "action" : {
        "type" : "command",
        "value" : "clipboardPaste"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "t",
      "action" : {
        "type" : "command",
        "value" : "windowNew"
      },
      "modifiers" : 1179648
    },
    {
      "input" : "w",
      "action" : {
        "type" : "command",
        "value" : "windowClose"
      },
      "modifiers" : 1179648
    },
    {
      "input" : "o",
      "action" : {
        "type" : "command",
        "value" : "windowFocusOther"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "t",
      "action" : {
        "type" : "command",
        "value" : "tabNew"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "w",
      "action" : {
        "type" : "command",
        "value" : "tabClose"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "]",
      "action" : {
        "type" : "command",
        "value" : "tabNext"
      },
      "modifiers" : 1179648
    },
    {
      "input" : "UIKeyInputRightArrow",
      "action" : {
        "type" : "command",
        "value" : "tabNext"
      },
      "modifiers" : 1179648
    },
    {
      "input" : "[",
      "action" : {
        "type" : "command",
        "value" : "tabPrev"
      },
      "modifiers" : 1179648
    },
    {
      "input" : "UIKeyInputLeftArrow",
      "action" : {
        "type" : "command",
        "value" : "tabPrev"
      },
      "modifiers" : 1179648
    },
    {
      "input" : "o",
      "action" : {
        "type" : "command",
        "value" : "tabMoveToOtherWindow"
      },
      "modifiers" : 1179648
    },
    {
      "input" : "+",
      "action" : {
        "type" : "command",
        "value" : "zoomIn"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "-",
      "action" : {
        "type" : "command",
        "value" : "zoomOut"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "=",
      "action" : {
        "type" : "command",
        "value" : "zoomReset"
      },
      "modifiers" : 1048576
    },
    {
      "input" : ",",
      "action" : {
        "type" : "command",
        "value" : "configShow"
      },
      "modifiers" : 1048576
    },
    {
      "input" : "",
      "action" : {
        "type" : "command",
        "value" : "clipboardCopy"
      },
      "modifiers" : 0
    }
  ],
  "fn" : {
    "shiftLoc" : 0,
    "controlLoc" : 0,
    "optionLoc" : 0,
    "keys" : [
      "91:1"
    ],
    "commandLoc" : 0,
    "action" : {
      "type" : "none"
    }
  },
  "capsLock" : {
    "code" : {
      "code" : "CapsLock",
      "id" : "20:0",
      "key" : "CapsLock",
      "keyCode" : 20
    },
    "down" : "",
    "up" : "",
    "ignoreAccents" : true,
    "mod" : "Escape"
  },
  "shift" : {
    "right" : {
      "code" : {
        "code" : "ShiftRight",
        "id" : "16:2",
        "key" : "Shift",
        "keyCode" : 16
      },
      "down" : "",
      "up" : "",
      "ignoreAccents" : true,
      "mod" : "Shift"
    },
    "same" : true,
    "left" : {
      "code" : {
        "code" : "ShiftLeft",
        "id" : "16:1",
        "key" : "Shift",
        "keyCode" : 16
      },
      "down" : "",
      "up" : "",
      "ignoreAccents" : true,
      "mod" : "Shift"
    }
  },
  "command" : {
    "right" : {
      "code" : {
        "code" : "MetaRight",
        "id" : "93:2",
        "key" : "Meta",
        "keyCode" : 93
      },
      "down" : "",
      "up" : "",
      "ignoreAccents" : true,
      "mod" : ""
    },
    "same" : true,
    "left" : {
      "code" : {
        "code" : "MetaLeft",
        "id" : "91:1",
        "key" : "Meta",
        "keyCode" : 91
      },
      "down" : "",
      "up" : "",
      "ignoreAccents" : true,
      "mod" : ""
    }
  },
  "control" : {
    "right" : {
      "code" : {
        "code" : "ControlRight",
        "id" : "17:2",
        "key" : "Control",
        "keyCode" : 17
      },
      "down" : "",
      "up" : "escape",
      "ignoreAccents" : true,
      "mod" : "Control"
    },
    "same" : true,
    "left" : {
      "code" : {
        "code" : "ControlLeft",
        "id" : "17:1",
        "key" : "Control",
        "keyCode" : 17
      },
      "down" : "",
      "up" : "escape",
      "ignoreAccents" : true,
      "mod" : "Control"
    }
  }
}

504C106D-8FB5-41E2-B295-15F14F6744BC

Keyboard language is set to “English (U.S.)”

Describe the bug

When the Option key is set to press_send=none as_modifier=esc, keystrokes using the Option key which the operating system interprets as a unicode combining diacritic codepoint (“dead key”), send both the intended keystroke (e.g. Option+I sends <a-i> to my editor) and the combining diacritic (e.g. for Option+I, this is ˆ U+02C6 MODIFIER LETTER CIRCUMFLEX ACCENT). This results in garbage keyboard input being sent to the running program, and makes certain keybindings impossible to execute.

Note that for keystrokes which the operating system doesn’t interpret as a unicode combining diacritic codepoint, but rather an accented character (such as Option+A which the operating system normally interprets as å U+00E5 LATIN SMALL LETTER A WITH RING ABOVE), blink only sends the intended <esc>[byte] sequence (e.g. my editor interprets it as <a-a>).

The expected behavior is that Blink sends ONLY the <esc>[byte] sequence to the running program, without also sending the combining diacritic.

This issue was reported previously in #1195, where the issue was resolved by changing the keyboard language to “English (U.S.).” That doesn’t resolve the issue in my case.

Here are two videos which show my editor logging every keystroke it receives in the pane on the right:

Key sequence Option+I W

https://user-images.githubusercontent.com/183309/219882415-1f37afc1-88f9-4c0d-9170-459785b9b59e.MOV

key sequence Option+A W

https://user-images.githubusercontent.com/183309/219883122-5122cc92-81e3-494e-8d35-e87c88ae542d.MOV

adrusi avatar Feb 18 '23 18:02 adrusi

Hey Autumn, thanks for this report. I'm trying to replicate it from my side. Do you have any special LANG setting in the remote? Would you mind sending the output from showkey -a in a blink shell and in the remote as well?

Option as Esc modifier is quite common. I use it all the time on eMacs without problem. Ignore accents is used for other languages than English where that may cause another sequence, don't think it applies here.

carloscabanero avatar Mar 23 '23 23:03 carloscabanero

I am not sure this is related, but if I set option to escape (which seems to be the default now) I can no longer enter any symbol that requires the Option key on my Magic Keyboard on iPad. This is - among others - @ (option-l), | (option-7), \ (option-shift-7) I had to manually switch back to default to get them to work again.

Works for me, but took me a while to figure out why blink suddenly broke o ipad.

eun-ice avatar Jun 27 '23 06:06 eun-ice