Figure out how to support bindings for "VK_OEM" keys #1610

Closed
opened 2026-01-30 22:31:59 +00:00 by claunia · 6 comments
Owner

Originally created by @DHowett-MSFT on GitHub (Jun 12, 2019).

Originally assigned to: @DHowett-MSFT on GitHub.

ecfaa76a89/src/cascadia/TerminalApp/KeyChordSerialization.cpp (L75-L85)

Originally created by @DHowett-MSFT on GitHub (Jun 12, 2019). Originally assigned to: @DHowett-MSFT on GitHub. https://github.com/microsoft/terminal/blob/ecfaa76a895da18a2997c4e7dbd4b3fccdf2d889/src/cascadia/TerminalApp/KeyChordSerialization.cpp#L75-L85
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 12, 2019):

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

@DHowett-MSFT commented on GitHub (Jun 12, 2019): Yanking the triage tag. This is a `TODO` from code.
Author
Owner

@shanselman commented on GitHub (Jun 12, 2019):

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

For horizontal I’m using CTRL+SHIFT+- which is CTRL+_

FYI+context

@shanselman commented on GitHub (Jun 12, 2019): I’m looking to have CTRL+| (which is ctrl shift \ on my keyboard) split vertical. Not possible today. For horizontal I’m using CTRL+SHIFT+- which is CTRL+_ FYI+context
Author
Owner

@timheuer commented on GitHub (Jun 12, 2019):

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.

@timheuer commented on GitHub (Jun 12, 2019): 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.
Author
Owner

@zadjii-msft commented on GitHub (Jun 12, 2019):

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...)

@zadjii-msft commented on GitHub (Jun 12, 2019): 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...)
Author
Owner

@binarycrusader commented on GitHub (Jun 14, 2019):

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

@binarycrusader commented on GitHub (Jun 14, 2019): > 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
Author
Owner

@ghost commented on GitHub (Aug 3, 2019):

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

Handy links:

@ghost commented on GitHub (Aug 3, 2019): :tada:This issue was addressed in #2067, which has now been successfully released as `Windows Terminal Preview v0.3.2142.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.3.2142.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1610