Terminal: Figure out how to support bindings for "VK_OEM" keys

Created on 12 Jun 2019  路  6Comments  路  Source: microsoft/terminal

Most helpful comment

I'd really love it if there was a way that we could just take a character and get the vkey from it. That way, if a user put ctrl+| in their json, we'd try to find the key from the char in our map, fail, then ask the OS what vkey that should be. We'd look up what the actual vkey is, find VK_OEM_5, Shift, and use that key+modifiers at runtime. There's a pretty good chance there's a relative of MapVirtualKey that might work for that purpose. However, we'd need to make sure that when we re-serialize the key, that we don't lose the original. (granted, that would be fixed by #754, so maybe we should do that one first or just live with it for now...)

All 6 comments

Yanking the triage tag. This is a TODO from code.

I鈥檓 looking to have CTRL+| (which is ctrl shift \ on my keyboard) split vertical. Not possible today.

For horizontal I鈥檓 using CTRL+SHIFT+- which is CTRL+_

FYI+context

One way maybe to be able to handle this would be to allow VK_** int values to be used in the binding 'language' to avoid a bunch of hard coding of VK and missing ones. enables you to you say "ctrl+(vk)32" ? -- just a wild idea.

I think in @shanselman use case, supporting a keybinding that already involves a modifier might be tough (I don't see cmder/conemu handle this either). But even supporting CTRL+\ (the non-shifted pipe character that maps to VK_SEPARATOR) doesn't work right now.

I'd really love it if there was a way that we could just take a character and get the vkey from it. That way, if a user put ctrl+| in their json, we'd try to find the key from the char in our map, fail, then ask the OS what vkey that should be. We'd look up what the actual vkey is, find VK_OEM_5, Shift, and use that key+modifiers at runtime. There's a pretty good chance there's a relative of MapVirtualKey that might work for that purpose. However, we'd need to make sure that when we re-serialize the key, that we don't lose the original. (granted, that would be fixed by #754, so maybe we should do that one first or just live with it for now...)

I'd really love it if there was a way that we could just take a character and get the vkey from it.

I think this is what you're looking for in this case:

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-oemkeyscan

And then for keys on the "Main" keyboard, there's also:

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-vkkeyscanexa

:tada:This issue was addressed in #2067, which has now been successfully released as Windows Terminal Preview v0.3.2142.0.:tada:

Handy links:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

alabuzhev picture alabuzhev  路  3Comments

NickITGuy picture NickITGuy  路  3Comments

xmm1989218 picture xmm1989218  路  3Comments

warpdesign picture warpdesign  路  3Comments