It is currently March 28th, 2024, 9:26 am

Mouse plugin from NighthawkSLO

Plugins and Addons popular with the Community
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Mouse plugin from NighthawkSLO

Post by Yincognito »

Active Colors wrote: July 9th, 2021, 5:33 pmA regular computer user would instantly drag the knob when they see it. Besides, it is just more intuitive rather than scroll mouse, in my opinion. And it is just about human's perception based on associations. Remember this dude?
Indeed. This is interesting though, since you get better precision on scrolling than on dragging, especially when the difference between two values is just a matter of 1px. :confused:
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

Re: Mouse plugin from NighthawkSLO

Post by death.crafter »

Yincognito wrote: July 9th, 2021, 6:18 pm Indeed. This is interesting though, since you get better precision on scrolling than on dragging, especially when the difference between two values is just a matter of 1px. :confused:
Why not just use all?

Drag it, scroll it, click it. If it's a slider, it should do it all. Well, that's what I believe.
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany
Contact:

Re: Mouse plugin from NighthawkSLO

Post by Active Colors »

Yincognito wrote: July 9th, 2021, 6:18 pm Indeed. This is interesting though, since you get better precision on scrolling than on dragging, especially when the difference between two values is just a matter of 1px. :confused:
Yeah I understand. As death.crafter said — leave them all. I am about to have a drag bar which regulates a value from 1 to 400, hell no I am going to have a 400px wide bar. Dragging will of course drop out some in-between value, so mouse scrolling will be of use here (or manually typing a value).
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Mouse plugin from NighthawkSLO

Post by Yincognito »

Yep, agree with you both (death.crafter & ActiveColors): a slider should accept all possible inputs, when it comes to complete applications / implementations (which not even Windows is, in all places, try to scroll on Settings / System / Sound / Volume and you'll see what I mean - I guess it's a leftover behavior from their goal to make the OS a mobile-fixed hybrid, i.e. you can only drag a slider on a touch screen, "scrolling" is more about positioning the viewport there).

That being said, my point was that in the context of Rainmeter, clicking and scrolling are the easiest choices for both the skin designer (e.g. no additional plugin or specific code required, all things "built in", so to speak; no slider size constraints either) and the user (e.g. top precision without the need to slow motion your mouse movement down to pixel level). In that context, I was wondering why scrolling seems to be less used, despite its simplicity all around - a rhetorical question, if you like. Hope I made myself better understood this time. :D
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mouse plugin from NighthawkSLO

Post by balala »

Active Colors wrote: July 9th, 2021, 5:33 pm Thank you balala for sharing your methd. I wanted to escape "mapping" the bar but I suppose that's the only viable way to do it with the current condition of Rainmeter. I will use your way and I will think about how to optimize it.
As I said it's neither easy and definitely nor short, but it does work. However even if I used it years ago, in meantime since plugins came out, I renounced to this method. Simply doesn't worth anymore to use it.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

Re: Mouse plugin from NighthawkSLO

Post by death.crafter »

Yincognito wrote: July 9th, 2021, 7:33 pm (which not even Windows is, in all places, try to scroll on Settings / System / Sound / Volume and you'll see what I mean - I guess it's a leftover behavior from their goal to make the OS a mobile-fixed hybrid, i.e. you can only drag a slider on a touch screen, "scrolling" is more about positioning the viewport there)
Well, Windows sliders are calibrated to perfection, so it's beyond the scope of comparison :lol:
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Mouse plugin from NighthawkSLO

Post by Yincognito »

death.crafter wrote: July 9th, 2021, 8:04 pm Well, Windows sliders are calibrated to perfection, so it's beyond the scope of comparison :lol:
Of course, of course... :rolmfao:
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Demonstrating the Mouse plugin

Post by Yincognito »

StArL0rd84 wrote: July 3rd, 2017, 8:02 pm Figured it could also be used to resize a skin :D
Not just a skin, but also visually move or resize any non-transparent meter in a skin... 8-)

Code: Select all

[Variables]
AreaHP=X
AreaVP=Y
AreaHS=W
AreaVS=H
StyleB=1
StyleO=2
MeterN=
CoordT=
MouseX=0
MouseY=0

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

---Measures---

[Mouse]
Measure=Plugin
Plugin=Mouse
LeftMouseDragAction=[!SetOption [#MeterN] [#AreaH[#CoordT]] ($MouseX$-[#MouseX])][!SetOption [#MeterN] [#AreaV[#CoordT]] ($MouseY$-[#MouseY])][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!CommandMeasure Mouse "Stop"]
RequireDragging=1
DynamicVariables=1

---Styles---

[StyleMMU]
MiddleMouseUpAction=[!SetVariable StyleB (1-#StyleB#)][!SetVariable StyleO (2-#StyleO#)][!ToggleMeasure Mouse][!UpdateMeasure Mouse][!UpdateMeter *][!Redraw]

[StyleLMD0]

[StyleLMD1]
LeftMouseDownAction=[!SetVariable MeterN "#CURRENTSECTION#"][!SetVariable CoordT "S"][!SetVariable MouseX 0][!SetVariable MouseY 0][!CommandMeasure Mouse "Start"]

[StyleLMD2]
LeftMouseDownAction=[!SetVariable MeterN "#CURRENTSECTION#"][!SetVariable CoordT "P"][!SetVariable MouseX $MouseX$][!SetVariable MouseY $MouseY$][!CommandMeasure Mouse "Start"]

---Meters---

[Background]
Meter=Image
MeterStyle=StyleMMU | StyleLMD#StyleB#
X=0
Y=0
W=500
H=500
SolidColor=0,0,255,255
UpdateDivider=-1
DynamicVariables=1

[ImageOne]
Meter=Image
MeterStyle=StyleMMU | StyleLMD#StyleO#
X=30
Y=50
W=100
H=100
SolidColor=255,0,0,255
UpdateDivider=-1
DynamicVariables=1

[TextOne]
Meter=String
X=([ImageOne:W]/2)r
Y=([ImageOne:H]/2)r
StringAlign=CenterCenter
AntiAlias=1
Text=One
UpdateDivider=-1
DynamicVariables=1

[ImageTwo]
Meter=Image
MeterStyle=StyleMMU | StyleLMD#StyleO#
X=50
Y=80
W=50
H=50
SolidColor=0,255,0,255
UpdateDivider=-1
DynamicVariables=1

[TextTwo]
Meter=String
X=([ImageTwo:W]/2)r
Y=([ImageTwo:H]/2)r
StringAlign=CenterCenter
AntiAlias=1
Text=Two
UpdateDivider=-1
DynamicVariables=1
Left drag on any of the R, G and B meters to move or resize stuff. Middle click on any of them to toggle between the drag behavior and the normal one.

With some effort, it could be made to create a "visual studio" for skins and their meters, at least for coordinates that are not dynamic in nature.
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Mouse plugin from NighthawkSLO

Post by Nookz »

Is it possible to use $MouseY:%$ and $MouseX:%$ with this plugin?

I keep getting this error:
Formula: "MouseY" is unknown: (100-$MouseY:%$)
when using this
[!SetVariable H "(100-$MouseY:%$)"]

But if I change it to something simpler and not at all as accurate like:
(325-$MouseY$)
then it doesn't throw any error.. :?
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Mouse plugin from NighthawkSLO

Post by Yincognito »

Nookz wrote: November 7th, 2023, 2:43 am Is it possible to use $MouseY:%$ and $MouseX:%$ with this plugin?

I keep getting this error:
Formula: "MouseY" is unknown: (100-$MouseY:%$)
when using this
[!SetVariable H "(100-$MouseY:%$)"]

But if I change it to something simpler and not at all as accurate like:
(325-$MouseY$)
then it doesn't throw any error.. :?
Apparently, $MouseX:%$ and $MouseY:%$ are not replaced with values by the plugin, like $MouseX$ and $MouseY$ are. You could however, use RelativeToSkin=1 and calculate those percentages yourself, via dividing $MouseX$ or $MouseY$ by #CURRENTCONFIGWIDTH# and multiplying with 100. Further adjustments can be made if you need the percentages relative to meters, but I'll let you figure that yourself. ;-)
Post Reply