blink icon indicating copy to clipboard operation
blink copied to clipboard

Keyboard corruption with Caps Lock remapped to Ctrl

Open jgoerzen opened this issue 3 years ago • 5 comments

Hi,

Thanks for blink!

I have an iPad Pro 9.7 with the Apple keyboard for it. I want to use Caps Lock as Ctrl. So, in config -> Keyboard I have assigned Caps Lock to Ctrl.

When I attempt to use it, the behavior is pretty odd. Usually after doing that, the keyboard is unusable; further keypresses — even just typing plain text — may do nothing at all, or may send garbage, or may corrupt the terminal, or sometimes hang the terminal session. Command-T to open a new tab will be fine, and that tab will work normally (at least until I try to use Caps Lock as Ctrl in it), but the original one will remain hosed.

jgoerzen avatar Jan 22 '22 23:01 jgoerzen

I had the same configuration and ended up turning it off (Ctrl as Caps Lock modifier). As soon as I press Caps Lock and a letter, the Ctrl key is held down and locked. Just pressing "c" shows "^C" on the terminal. Tapping Caps Lock again does not release the Ctrl lock. This happens on the latest Community TF version (v14.0.7.433).

aque avatar Feb 06 '22 22:02 aque

Marking as a bug. The issue is on internal iOS changes that now don't play well with our changes.

Workaround for now, is to go to iOS Settings > Keyboard > Hardware > Modifiers and make the change there. Note that iOS also has a bug and sometimes the caps will actually end up pressed and you will have to go again to settings, remove and re-add, but at least it is more reliable.

carloscabanero avatar Feb 07 '22 16:02 carloscabanero

I'm having this issue, too - more than a year later. I've set up Caps Lock to send Escape on release, and otherwise work as a Ctrl modifier. If I use it once, it gets stuck in Ctrl "mode" - the only way to get out of it is killing the app.

It never sends Escape, which is an additional bug. It also has to be noted that the Ctrl issue is present regardless of whether I have the Esc functionality set up.

Edit: right now not even killing and restarting the app would get out of this "Ctrl mode". Once it appeared that killing Blink, pressing Caps Lock once and restarting it would get me back to normal, but not even that is working any more. I'm playing around with iOS keyboard settings, and setting Caps Lock to send Ctrl there and back won't fix this either.

Edit 2: A missing ingredient was switching the keyboard on and off. Right now setting Caps Lock to Ctrl in iOS, then Escape on release + Ctrl in Blink gets Ctrl working. No Escape is ever sent, though. That's because this is basically just the iOS setting working, Blink never picks up Caps being pressed.

So the winning solution:

  • Set up Caps Lock to send Ctrl in iOS.
  • Ignore the Caps Lock key in Blink, just leave it at default.
  • Set up Ctrl itself in Blink to send Escape on release, otherwise work as a Ctrl modifier.

steerio avatar Mar 22 '23 13:03 steerio

Thanks for jumping in. We will make a review from our side of how we should proceed from here with Caps. Since Apple introduced their own way to map Caps, our approach is now less relevant for the modifier case. We need to check what makes sense now.

carloscabanero avatar Mar 22 '23 17:03 carloscabanero

Any update on the issue? I am facing the same problem with Caps Lock mapped to Ctrl and sending Escape on Release - Escape is never sent

wpauser-sps avatar May 11 '23 14:05 wpauser-sps