Fix bug that prevented the user to type accents correctly on some
keyboard layouts. Fix #86
This commit is contained in:
parent
ea7e92e087
commit
5f71d0ad24
|
@ -243,7 +243,12 @@ LRESULT CALLBACK window_procedure(HWND window, unsigned int msg, WPARAM wp, LPAR
|
||||||
if (GetKeyboardState(lpKeyState.data())) {
|
if (GetKeyboardState(lpKeyState.data())) {
|
||||||
// Convert the virtual key to an unicode char
|
// Convert the virtual key to an unicode char
|
||||||
std::array<WCHAR, 4> buffer;
|
std::array<WCHAR, 4> buffer;
|
||||||
int result = ToUnicodeEx(raw->data.keyboard.VKey, raw->data.keyboard.MakeCode, lpKeyState.data(), buffer.data(), buffer.size(), 0, currentKeyboardLayout);
|
|
||||||
|
// This flag is needed to avoid chaning the keyboard state for some layouts.
|
||||||
|
// Refer to issue: https://github.com/federico-terzi/espanso/issues/86
|
||||||
|
UINT flags = 1 << 2;
|
||||||
|
|
||||||
|
int result = ToUnicodeEx(raw->data.keyboard.VKey, raw->data.keyboard.MakeCode, lpKeyState.data(), buffer.data(), buffer.size(), flags, currentKeyboardLayout);
|
||||||
|
|
||||||
//std::cout << result << " " << buffer[0] << " " << raw->data.keyboard.VKey << std::endl;
|
//std::cout << result << " " << buffer[0] << " " << raw->data.keyboard.VKey << std::endl;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user