Alt key not working

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Alt key not working

Post by nomad »

I notice the left Alt key does not seem to send a EET_KEY_INPUT_EVENT, although the right AltGr key does sends a key input event. I don't know if there is a way around this without patching the engine, but here's what I did to fix it:

In CIrrDeviceWin32.cpp, I added a WM_SYSKEYDOWN message handler just before the WM_KEYDOWN message handler -

Code: Select all

	case WM_SYSKEYDOWN: //added - to get alt key message
		if (VK_F4 == (int) wParam) return DefWindowProc(hWnd, message, wParam, lParam); //added
	case WM_KEYDOWN:
		{
			event.EventType = irr::EET_KEY_INPUT_EVENT;
The idea with calling DefWindowProc is to process ALT-F4 messages to close the app.

Similarily with WM_KEYUP -

Code: Select all

	case WM_SYSKEYUP: //added
	case WM_KEYUP:
		{
			event.EventType = irr::EET_KEY_INPUT_EVENT;
This seems to have fixed my problem, now I can use CTRL-ALT key combinations, etc.
Post Reply