mausimus / ShaderGlass

Overlay for running GPU shaders on top of Windows desktop
GNU General Public License v3.0
970 stars 37 forks source link

Hide actual cursor when capturing cursor #10

Open somatronicon opened 3 years ago

somatronicon commented 3 years ago

I'm using this full-screen on my main machine because it's awesome. One thing I noticed is that although I have the cursor captured, I'm still seeing my actual cursor ghosting around in front of it. When using shaders with a curve, the cursor is visible as I near the corners and is offset due to the curvature.

I think there is a Win32 API to hide the cursor in a Window, I just haven't been down that road for so long I don't remember what it is.

BTW, +1 for using C++ and Win32 API; that's how I cut my teeth on C++ and MASM32 20+ years ago.

My preset is as follows:

ProfileVersion "1.0"
PixelSize "1"
AspectRatio "1"
ShaderCategory "crt"
ShaderName "crt-lottes-multipass"
FrameSkip "2"
OutputScale "100"
FlipH "0"
FlipV "0"
Clone "0"
CaptureCursor "1"
Transparent "1"
rohatsu commented 2 years ago

Hey apologies for the late reply, the problem is if I hide the cursor then it completely disappears, including from the capture... not seeing a good way around this other than adding a cursor manually onto the captured image (bit of a can of worms). The main use-case for Capture Cursor was with Clone mode although that probably won't work for you in full-screen.

thatonespookymonth commented 2 years ago

Maybe you could make the fullscreen go over the mouse, effectively removing the problem or just apply shaders to the mouse too idk

RationalFragile commented 2 years ago

Dealing with the same issue while trying to flip my screen and having two cursors.

I have an idea: Magpie is able to somehow able to transform the cursor to the correct shape even though it is physically not in that place. Example, if you select an explorer window and apply Magpie to it, and then hover over a text field, the cursor changes to text-edit shape, even though the location of the Windows' cursor is different than the location of the text field in the non-scaled window. So, a solution to this issue in ShaderGlass can be to hide the Windows's cursor, capture all mouse input with a hook, pass along the mouse to the desktop, and then get the shape of the cursor, apply it to the input, and so it will get drawn correctly in the output.

skygate2012 commented 2 years ago

@RationalFragile Exactly. I wrote an AHK script earlier that's implemented this way. Would love to see this implemented natively.

RationalFragile commented 2 years ago

@skygate2012 Sounds cool! Can you share your AHK script?

skygate2012 commented 2 years ago

@RationalFragile Sure mouse_emulator.zip

TakahashiEdenyako commented 1 month ago

How do you open mouse_emulator.zip with shader glass? I want my cursor to match with the shader.