libuv icon indicating copy to clipboard operation
libuv copied to clipboard

Enable quirky ANSI keys on Windows.

Open parkovski opened this issue 6 years ago • 21 comments

Fixes #1958. I've checked these bindings in plain conhost, conhost/tmux, and Windows Terminal/tmux.

parkovski avatar Nov 03 '19 19:11 parkovski

Could help for someone not on a US keyboard layout to try this in their normal workflow. I tried to cover those cases but I use a US keyboard layout so I can't say for sure if there's not some quirks I missed.

Other than that, I've been using this patch daily in neovim for months with no issues. I hope this is a small enough/well documented enough change, because doing automated tests for all the variations of regular console/conpty/conpty over WSL interop/keyboard layouts is a pretty daunting project that I probably couldn't take on for a while.

parkovski avatar Dec 09 '19 05:12 parkovski

@libuv/windows This PR is in need of review. It looks okay to me but I'm not qualified to judge.

bnoordhuis avatar Dec 09 '19 10:12 bnoordhuis

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.

stale[bot] avatar Jan 13 '20 18:01 stale[bot]

This is not stale, it is waiting on maintainer response.

justinmk avatar Jan 13 '20 19:01 justinmk

So this is unfortunately more complicated than I'd thought (of course it is). At least for console apps, VkScanKey doesn't use the current keyboard layout, it uses whichever the app was started with, so you need to listen for WM_INPUTLANGCHANGE which requires a WndProc somewhere which libuv currently doesn't appear to have...

It seems to me like there are a couple of options here:

  1. Load the current keyboard layout on every key press. This option doesn't feel that great to me, but...?
  2. Do it the "right" way, creating a WndProc and caching the keyboard layout and/or the VK code for the / key when the language changes.
  3. Pull the VK code check into a global that's checked at startup, commit this with the caveat that it doesn't handle keyboard changes correctly (really only affects the / key) and create a new issue for this.

parkovski avatar Jan 30 '20 18:01 parkovski

Pull the VK code check into a global that's checked at startup, commit this with the caveat that it doesn't handle keyboard changes correctly (really only affects the / key) and create a new issue for

That one.

justinmk avatar Jan 31 '20 05:01 justinmk

1 or 3 sounds good to me. We already can’t synchronize the stream exactly. I’d slightly lean towards doing 1 though and/or rereading it occasionally instead of at startup (eg whenever setting the mode to raw)

vtjnash avatar Feb 03 '20 20:02 vtjnash

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.

stale[bot] avatar Feb 24 '20 20:02 stale[bot]

@parkovski were you still working on making this functional (https://github.com/libuv/libuv/pull/2535#discussion_r371508163)?

vtjnash avatar Jul 28 '20 17:07 vtjnash

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.

stale[bot] avatar Oct 13 '20 10:10 stale[bot]

bump @parkovski

vtjnash avatar May 28 '21 15:05 vtjnash

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.

stale[bot] avatar Jun 18 '21 23:06 stale[bot]

bad bot

musm avatar Jun 19 '21 13:06 musm

Hey, life has been hectic for a while. I do want to get this fixed, I'll look into it in the next couple weeks. Iirc there were lots different setups to test and I'll need to refamiliarize myself with them.

parkovski avatar Jun 30 '21 05:06 parkovski

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.

stale[bot] avatar Jul 23 '21 05:07 stale[bot]

Please don't bot, I'm getting to it.

parkovski avatar Jul 24 '21 17:07 parkovski

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.

stale[bot] avatar Aug 18 '21 02:08 stale[bot]

nuisance bot

justinmk avatar Aug 18 '21 12:08 justinmk

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.

stale[bot] avatar Sep 19 '21 20:09 stale[bot]

nuisance bot

justinmk avatar Sep 19 '21 22:09 justinmk

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Oct 30 '21 17:10 stale[bot]

Did you get a chance to resolve https://github.com/libuv/libuv/pull/2535#issuecomment-580394201? (https://github.com/libuv/libuv/pull/2535#discussion_r369175125)

vtjnash avatar Jan 19 '23 20:01 vtjnash

Seeing there's been no follow-up I'll go ahead and close this.

bnoordhuis avatar Aug 21 '23 11:08 bnoordhuis