| Summary: | WinRT: Mouse events not woring correctly | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Paul Cunningham <paul.cunningham> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | flibitijibibo |
| Version: | 2.0.12 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
The important parts: https://hg.libsdl.org/SDL/file/9be2761aa0f3/src/core/winrt/SDL_winrtapp_direct3d.cpp#l352 https://hg.libsdl.org/SDL/file/9be2761aa0f3/src/core/winrt/SDL_winrtapp_direct3d.cpp#l744 https://hg.libsdl.org/SDL/file/9be2761aa0f3/src/video/winrt/SDL_winrtpointerinput.cpp#l228 I don't have a WinRT environment to test, do you have a working patch for me to review? Hi Sam, I don't unfortuantely but I'll try and get it set up so I can debug and see if I can figure out what the issue is. Paul |
I've noticed an issue with the mouse on SDL WinRT. If a mouse button is held, other mouse button events do not get fired / handled. e.g. Hold MOUSE1 - SDL_MOUSEBUTTONDOWN (1) fired correctly Hold MOUSE2 - no event fired The following situation IS handled correctly... Hold MOUSE1 - SDL_MOUSEBUTTONDOWN (1) fired correctly Release MOUSE1 - SDL_MOUSEBUTTONUP (1) fired correctly Hold MOUSE2 - SDL_MOUSEBUTTONDOWN (3) fired correctly Release MOUSE1 - SDL_MOUSEBUTTONUP (3) fired correctly private static SDL.SDL_EventFilter _winRTEvents = WinRTEvents; private static unsafe int WinRTEvents(IntPtr userdata, IntPtr evtPtr) { SDL.SDL_Event* evt = (SDL.SDL_Event*)evtPtr; switch (evt->type) { case SDL.SDL_EventType.SDL_MOUSEBUTTONDOWN: Debug.WriteLine($"WinRT event handler SDL_MOUSEBUTTONDOWN {evt->button.button}"); break; case SDL.SDL_EventType.SDL_MOUSEBUTTONUP: Debug.WriteLine($"WinRT event handler SDL_MOUSEBUTTONUP {evt->button.button}"); break; case SDL.SDL_EventType.SDL_APP_TERMINATING: Debug.WriteLine("WinRT event handler SDL_APP_TERMINATING -> Exiting()"); break; case SDL.SDL_EventType.SDL_APP_WILLENTERBACKGROUND: Debug.WriteLine("WinRT event handler SDL_APP_WILLENTERBACKGROUND -> Suspending()"); break; case SDL.SDL_EventType.SDL_APP_WILLENTERFOREGROUND: Debug.WriteLine("WinRT event handler SDL_APP_WILLENTERFOREGROUND -> Resuming()"); break; } return 1; } public void Run(LaunchOptions launchOptions) { _launchOptions = launchOptions; SDL.SDL_SetHint("SDL_WINRT_HANDLE_BACK_BUTTON", "1"); SDL.SDL_AddEventWatch(_winRTEvents, IntPtr.Zero); SDL.SDL_main_func mainFunction = FakeMain; SDL.SDL_WinRTRunApp(mainFunction, IntPtr.Zero); } Issue happens with / without the custom event filter This is a WinRT / UWP project running on Windows 10 Home 10.0.19041 Build 19041 SDL is used via FNA Core (DEBUG / x64) FNA source up to date as at Nov 14, 2020 FNA dependences (FNA3D, etc) built from source on Nov29, 2020 SDL version 2.0.12 (stable) FNA issue https://github.com/FNA-XNA/FNA/issues/338