Welcome, Guest.
Username: Password: Remember me

TOPIC: Left Mouse detection doesn't work?

Left Mouse detection doesn't work? 1 year 6 months ago #1

For some reason, ReShade isn't detecting my left mouse button. All the other mouse buttons work fine.
According to REFERENCE.md, ReShade supports 6 mouse buttons (0-5), but I don't have enough mouse buttons to test the last one.

The problem is also mentioned here, but there were no replies. Is this a known issue? Has anybody else had this problem?

How I tested. Pretty straightforward. Pressing mouse buttons changes the color of the entire screen.
I tested using Vampire: the Masquerade - Bloodlines.
uniform bool bLeftMouseToggle <source="mousebutton"; keycode=0; toggle=true;>;		//Doesn't work
uniform bool bRightMouseToggle <source="mousebutton"; keycode=1; toggle=true;>;		 //Works
uniform bool bMiddleMouseToggle <source="mousebutton"; keycode=2; toggle=true;>;	//Works
uniform bool bMouse4Toggle <source="mousebutton"; keycode=3; toggle=true;>;		//Works
uniform bool bMouse5Toggle <source="mousebutton"; keycode=4; toggle=true;>;		//Works

float4 TestPS(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target {	
	float3 currentColor;
	if( bLeftMouseToggle ){
		currentColor = float3(1.0, 0.0, 0.0); //Red
	} else if( bRightMouseToggle ){
		currentColor = float3(0.0, 1.0, 0.0); //Green
	} else if( bMiddleMouseToggle ){
		currentColor = float3(0.0, 0.0, 1.0); //Blue
	} else if( bMouse4Toggle ){
		currentColor = float3(0.0, 1.0, 1.0); //Cyan
	} else if( bMouse5Toggle ){
		currentColor = float3(1.0, 0.0, 1.0); //Magenta
	}
	return float4(currentColor, 1.0);
}
Last Edit: 1 year 6 months ago by Citizenkane. Reason: typo
The administrator has disabled public write access.

Left Mouse detection doesn't work? 1 year 6 months ago #2

That's a bug. A pretty stupid one at that. ReShade checks if the keycode falls in the range [0,5[. Only the check was done like this until now: "keycode > 0 && keycode < 5", which fails for the left mouse button.
By the way, the reference is wrong too, only 5 mouse buttons are supported. Will fix that too.
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: Citizenkane

Left Mouse detection doesn't work? 1 year 6 months ago #3

Hey, thanks for the quick reply! No worries about the bug, I'm glad to know it's been fixed.

Any ETA on the next release? I've been working on a shader that does some stuff on mouse click, which I hope to release once a new version is up. I know the last version was fairly recent though, so I imagine you'll want to wait and bundle a bunch of changes into one patch. :)
Last Edit: 1 year 6 months ago by Citizenkane.
The administrator has disabled public write access.

Left Mouse detection doesn't work? 1 year 6 months ago #4

Yeah, there have been two changes since the last release so far. Could publish a hotfix sometime soon though.
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: Citizenkane

Left Mouse detection doesn't work? 1 year 6 months ago #5

That'd be great! :lol:
The administrator has disabled public write access.