Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【功能请求】支持鼠标穿透,窗口半透明情况下可以穿透鼠标。[Feature Request] Support mouse transparency, allowing mouse clicks to pass through when the window is semi-transparent. #588

Open
leehow1988 opened this issue Jan 9, 2025 · 0 comments

Comments

@leehow1988
Copy link

场景:
有时候跟着potplayer播放视频(采用无边框皮肤)的时候一边跟着做一边看视频。 这个时候播放器置顶显示且半透明,然后窗口下方是自己的编辑器软件。

问题:
由于播放器置顶显示的,会捕捉鼠标。当鼠标点击编辑器与播放器重叠区域的时候会被播放器捕捉到鼠标。无法在编辑器里通过鼠标移动光标位置。

功能请求:
让 AltSnap 支持一个快捷键设置窗口鼠标穿透(不再捕捉鼠标,在AutoHotKey里的指令是 WinSet, ExStyle, +0x20, PotPlayer)。

参考:
使用AutoHotKey的方法实现是:


English Version:

Scenario:
Sometimes while following along with a video in PotPlayer (using a borderless skin), I like to work and watch the video simultaneously. In this case, the player is set to always be on top and semi-transparent, with my editor software open beneath it.

Problem:
Since the player is set to always be on top, it captures mouse clicks. When I try to click on the overlapping area of the editor and the player, the player captures the mouse input. This prevents me from moving the cursor in the editor using the mouse.

Feature Request:
Please enable AltSnap to support a shortcut key that allows a window to become mouse-transparent (i.e., it no longer captures mouse input). In AutoHotKey, this is achieved with the command: WinSet, ExStyle, +0x20, PotPlayer .

Reference:
The method to achieve this using AutoHotKey is:

#Persistent
SetTitleMatchMode, 2 ; Set window title matching mode to fuzzy match.
WinWait, PotPlayer ; wait for PotPlayer window 

; 初始化状态变量
isMouseThrough := false

; Hot key Ctrl+T switch mouse through/capture status
^t::
    if (isMouseThrough) {
        ; Set Mouse Capture 
        WinSet, ExStyle, -0x20, PotPlayer
        isMouseThrough := false
        Tooltip, Mouse Capture Enabled
        SetTimer, RemoveTooltip, -1000
    } else {
        ; Set Mouse Through
        WinSet, ExStyle, +0x20, PotPlayer
        isMouseThrough := true
        Tooltip, Mouse Capture Disabled
        SetTimer, RemoveTooltip, -1000
    }
return

; Clear Tooltip
RemoveTooltip:
    Tooltip
return

GIF 2025-1-9 14-26-53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant