Skip to content

Commit aa8a02f

Browse files
ptrskyamaitland
authored andcommitted
WPF - Add support for Shift+AltGr (#3627)
* WPF - Add support for Shift+AltGr The handling of AltGr characters in CefBrowsterHostWrapper did not cover capital diacritic letters. This commit adds handling for the Shift + AltGr + character combination. * WPF - Shift+AltGr review fixes * Trigger rebuild
1 parent 16c1413 commit aa8a02f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,13 @@ void CefBrowserHostWrapper::SendKeyEvent(int message, int wParam, int lParam)
388388
// https://docs.microsoft.com/en-gb/windows/win32/api/winuser/nf-winuser-vkkeyscanexw
389389
// ... high-order byte contains the shift state,
390390
// which can be a combination of the following flag bits.
391+
// 1 Either SHIFT key is pressed.
391392
// 2 Either CTRL key is pressed.
392393
// 4 Either ALT key is pressed.
393394
SHORT scan_res = ::VkKeyScanExW(wParam, current_layout);
394-
if (((scan_res >> 8) & 0xFF) == (2 | 4)) // ctrl-alt pressed
395+
constexpr auto ctrlAlt = (2 | 4);
396+
constexpr auto shiftCtrlAlt = (1 | 2 | 4);
397+
if (((scan_res >> 8) & 0xFF) == ctrlAlt || ((scan_res >> 8) & 0xFF) == shiftCtrlAlt)
395398
{
396399
keyEvent.modifiers &= ~(EVENTFLAG_CONTROL_DOWN | EVENTFLAG_ALT_DOWN);
397400
keyEvent.modifiers |= EVENTFLAG_ALTGR_DOWN;

0 commit comments

Comments
 (0)