| 165 | return 0; |
| 166 | } |
| 167 | static DWORD _stdcall StateEventThread(void* pParam) |
| 168 | { |
| 169 | MSG msg = {}; |
| 170 | EventCallback* callBack = (EventCallback*)pParam; |
| 171 | State prev = {}; |
| 172 | State next = {}; |
| 173 | XBoxPad::state(&next); |
| 174 | prev = next; |
| 175 | while (!PeekMessageW(&msg, 0, msg_exit, msg_exit, PM_REMOVE)) |
| 176 | { |
| 177 | if (XBoxPad::state(&next)) |
| 178 | { |
| 179 | if (next.start != prev.start) callBack(start, next.start); |
| 180 | if (next.back != prev.back) callBack(back, next.back); |
| 181 | if (next.a != prev.a) callBack(a, next.a); |
| 182 | if (next.b != prev.b) callBack(b, next.b); |
| 183 | if (next.x != prev.x) callBack(x, next.x); |
| 184 | if (next.y != prev.y) callBack(y, next.y); |
| 185 | if (next.up != prev.up) callBack(up, next.up); |
| 186 | if (next.down != prev.down) callBack(down, next.down); |
| 187 | if (next.left != prev.left) callBack(left, next.left); |
| 188 | if (next.right != prev.right) callBack(right, next.right); |
| 189 | if (next.l_joy_press != prev.l_joy_press) callBack(l_joy_press, next.l_joy_press); |
| 190 | if (next.l_joy_up != prev.l_joy_up) callBack(l_joy_up, next.l_joy_up); |
| 191 | if (next.l_joy_down != prev.l_joy_down) callBack(l_joy_down, next.l_joy_down); |
| 192 | if (next.l_joy_left != prev.l_joy_left) callBack(l_joy_left, next.l_joy_left); |
| 193 | if (next.l_joy_right != prev.l_joy_right) callBack(l_joy_right, next.l_joy_right); |
| 194 | if (next.r_joy_press != prev.r_joy_press) callBack(r_joy_press, next.r_joy_press); |
| 195 | if (next.r_joy_up != prev.r_joy_up) callBack(r_joy_up, next.r_joy_up); |
| 196 | if (next.r_joy_down != prev.r_joy_down) callBack(r_joy_down, next.r_joy_down); |
| 197 | if (next.r_joy_left != prev.r_joy_left) callBack(r_joy_left, next.r_joy_left); |
| 198 | if (next.r_joy_right != prev.r_joy_right) callBack(r_joy_right, next.r_joy_right); |
| 199 | if (next.l_top != prev.l_top) callBack(l_top, next.l_top); |
| 200 | if (next.r_top != prev.r_top) callBack(r_top, next.r_top); |
| 201 | if (next.l_bottom != prev.l_bottom) callBack(l_bottom, next.l_bottom); |
| 202 | if (next.r_bottom != prev.r_bottom) callBack(r_bottom, next.r_bottom); |
| 203 | prev = next; |
| 204 | } |
| 205 | Sleep(1); |
| 206 | } |
| 207 | return 0; |
| 208 | } |
| 209 | static DWORD _stdcall PressEventThread(void* pParam) |
| 210 | { |
| 211 | MSG msg = {}; |
nothing calls this directly
no outgoing calls
no test coverage detected