package int poll_win_RawInput(ref InputEvent output) nothrow @nogc {
	MSG msg;
	BOOL bret = PeekMessageW(&msg, null, 0, 0, PM_REMOVE);
	if (bret) {
		////Some code that supposed to swallow WM_SYSKEY and the likes, but does not work as intended////
		DispatchMessageW(&msg);//In the aforementioned block
		////Function that optionally gets text input messages////
 		switch (msg.message & 0xFF_FF) {
////Regular user input handling via RawInput and some legacy stuff + XInput handling in separate function////

Since it’s for games, the default Alt key behavior is undesirable for me. It makes my test application hang and make error noises since it doesn’t have a menubar. I checked whether my window had a flag that enabled the menubar or not, but couldn’t find it.

  • Bazebara@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    One more thing I forgot to say. If default function of the alt key is to open menu, that it’s defined somewhere in your game, settings or the engine. If you try default loop in win32 api app with an empty window, alt key does nothing and you need actually bind it to change its behaviour to show menu. So I recommend to blame settings or an engine first before disabling events on so low level.

    Also such way of disabling events would prevent you of porting your app to other OSes like Linux and macOS