Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video: Added key conversion from other layouts to english one #12552

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions video/out/w32_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,14 @@ static int decode_key(struct vo_w32_state *w32, UINT vkey, UINT scancode)
}

int c = to_unicode(vkey, scancode, keys);
// Find utf-16 key value despite user's layout (only for english letters)
if ((vkey >= 65 && vkey <= 90) || (vkey >= 97 && vkey <= 122))
{
if ((keys[VK_SHIFT] & 0x80) || ((keys[VK_CAPITAL] & 0x01) && !(keys[VK_SHIFT] & 0x80)))
c = vkey;
else
c = vkey + 32;
}

// Some shift states prevent ToUnicode from working or cause it to produce
// control characters. If this is detected, remove modifiers until it
Expand Down