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

Problem with handleKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam) #28

Closed
Commondor opened this issue Oct 31, 2017 · 1 comment
Closed

Comments

@Commondor
Copy link

Commondor commented Oct 31, 2017

This function don't catch LeftAlt, RightAlt and LeftGUI (VK_LWIN) keys:

void handleKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam);

For LeftGUI (VK_LWIN) key need append:

	case VK_LWIN:
		if ((lParam & 0x1000000) == 0)
			vKey = VK_LWIN;
		else
			vKey = VK_RWIN;
		break;

For LeftAlt, RightAlt keys need append:

case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
case WM_KEYDOWN:
case WM_KEYUP:
    {
        handleKeyEvent(msg, wParam, lParam);
        break;
    }
@elnormous
Copy link
Owner

You don't have to check the lparam for VK_LWIN, because WV_LWIN and VK_RWIN are being sent correctly (you can test it yourself). You can also check the Microsoft's code: https://github.com/Microsoft/Windows-classic-samples/blob/master/Samples/IME/cpp/SampleIME/Globals.cpp#L334

I implemented the handling of the WM_SYSKEYDOWN and WM_SYSKEYUP. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants