How to implement in-game overlay window in Tauri 2.0 without losing game focus? #14084
Unanswered
Sparkel-wsl
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I'm developing a League of Legends assistant app using Rust + Tauri 2.0 (based on LCU API). I want to implement a feature similar to WeGame's in-game assistant: when pressing a hotkey (~) in-game, display an overlay window on top of the game screen without losing game focus or switching to desktop.
Current Issue:
Successfully implemented global hotkey to open window
However, when pressing the hotkey, the game loses focus and switches to desktop
Window appears on desktop instead of overlaying the game
Attempted Solutions:
Set window properties: always_on_top(true), skip_taskbar(true), decorations(false), transparent(true)
Used Windows API to set WS_EX_TOPMOST, WS_EX_LAYERED, WS_EX_NOACTIVATE
Used ShowWindow(hwnd, SW_SHOWNOACTIVATE)
Tried to restore game window focus immediately after showing window
Code Example:
Environment:
Tauri version: 2.0
OS: Windows 11
Target game: League of Legends
Expected Behavior:
Like WeGame's assistant, when pressing the hotkey, the window should appear directly on top of the game screen, the game should not lose focus, and players can continue playing.
Has anyone successfully implemented similar functionality? Any suggestions for solutions?
Beta Was this translation helpful? Give feedback.
All reactions