MCPcopy Create free account
hub / github.com/SpecialKO/SpecialK / SK_Input_ClassifyRawInput

Function SK_Input_ClassifyRawInput

src/input/raw_input.cpp:1099–1138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097}
1098
1099UINT
1100SK_Input_ClassifyRawInput ( HRAWINPUT lParam,
1101 bool& mouse,
1102 bool& keyboard,
1103 bool& gamepad )
1104{
1105 RAWINPUT data = { };
1106 UINT size = sizeof (RAWINPUT);
1107 const UINT ret =
1108 SK_ImGui_ProcessRawInput ( (HRAWINPUT)lParam,
1109 RID_INPUT,
1110 &data, &size,
1111 sizeof (RAWINPUTHEADER), TRUE );
1112
1113 if (ret == size)
1114 {
1115 switch (data.header.dwType)
1116 {
1117 case RIM_TYPEMOUSE:
1118 mouse = true;
1119 break;
1120
1121 case RIM_TYPEKEYBOARD:
1122 // TODO: Post-process this; the RawInput API also duplicates the legacy mouse buttons as keys.
1123 //
1124 // We need to treat events reflecting those keys as MOUSE events.
1125 keyboard = true;
1126 break;
1127
1128 default:
1129 gamepad = true;
1130 break;
1131 }
1132
1133 return
1134 data.header.dwSize;
1135 }
1136
1137 return 0;
1138}
1139
1140void
1141SK_Input_HookRawInput (void)

Callers 3

PeekMessageA_DetourFunction · 0.85
PeekMessageW_DetourFunction · 0.85
SK_ImGui_HandlesMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected