It is currently March 28th, 2024, 1:19 pm

New and Improved Mouse Wheel Actions!

Changes made during the Rainmeter 2.5 beta cycle and earlier.
Post Reply
User avatar
RainmeterTeam
Posts: 12
Joined: October 6th, 2011, 11:59 pm

New and Improved Mouse Wheel Actions!

Post by RainmeterTeam »

Update: Today's beta removes the need to click on a skin to give it "focus" before using mouse scroll wheel options.

In the latest beta, we have added several more mouse actions as well as the ability to run bang(s) when the skin gets or loses focus.

Mouse Wheel Scrolling Actions:
  • The following actions can be placed under any meter and/or the [Rainmeter] section (just like other mouse actions). Like other mouse actions, your cursor needs to placed over the meter for the scrolling action to fire (or over the skin if used in the [Rainmeter] section).
  • MouseScrollDownAction: Action to execute when the mouse wheel is rotated downward.
  • MouseScrollUpAction: Action to execute when the mouse wheel is rotated upward.
  • MouseScrollLeftAction: Action to execute when the mouse wheel is tilted or rotated to the left. Note: Not all mice have this capability.
  • MouseScrollRightAction: Action to execute when the mouse wheel is tilted or rotated to the right. Note: Not all mice have this capability.

Extra Mouse Buttons: (These work just like Left/Right/Middle mouse actions.)
  • Note: Some manufacturers and/or software have the ability to change what each extra button can do, therefore these actions may not work for everyone. It is not recommended to distribute skins that rely on these actions.
  • X1MouseDownAction
  • X1MouseUpAction
  • X1MouseDoubleClickAction
  • X2MouseDownAction
  • X2MouseUpAction
  • X2MouseDoubleClickAction

Skin Focus Actions:
  • These must be placed in the [Rainmeter] section.
  • OnFocusAction: Action to execute when the skin gets focus (usually by clicking the mouse somewhere on the skin).
  • OnUnfocusAction: Action to execute when the skin loses focus.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New and Improved Mouse Wheel Actions!

Post by jsmorley »

Here is a simple skin that demonstrates the new mouse wheel options including the change today to not require "focus" on the skin to use them:
ScrollVolume_1.5.rmskin
(106.34 KiB) Downloaded 543 times
ScrollVolume.png

Code: Select all

[Rainmeter]
Update=1000
MouseOverAction=[!SetOption MeterVolumeBar BarColor 189,255,168,255][!UpdateMeter MeterVolumeBar][!Redraw]
MouseLeaveAction=[!SetOption MeterVolumeBar BarColor 161,232,139,255][!UpdateMeter MeterVolumeBar][!Redraw]

[Metadata]
Name=ScrollVolume
Author=JSMorley
Information=Controls the system volume by scrolling the mouse wheel. Change VolumeIncrement to have the change be larger or smaller on each scroll. Clicking the speaker icon toggles mute.||Requires Windows 7 or better.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Nov 15, 2012

[Variables]
VolumeIncrement=5

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin
IfBelowValue=0
IfBelowAction=[!SetOption MeterVolumeIcon ImageName "#@#Images\mute_white.png"][!SetOption MeterVolumeText Text "Mute"][!UpdateMeter MeterVolumeText][!UpdateMeter MeterVolumeIcon][!Redraw]
IfAboveValue=-1
IfAboveAction=[!SetOption MeterVolumeIcon ImageName "#@#Images\volume_white.png"][!SetOption MeterVolumeText Text "[*MeasureWin7Audio:*]%"][!UpdateMeter MeterVolumeText][!UpdateMeter MeterVolumeIcon][!Redraw]

[MeterBackground]
Meter=Image
W=220
H=50
SolidColor=0,0,0,190
MouseScrollDownAction=[!CommandMeasure "MeasureWin7Audio" "ChangeVolume -#VolumeIncrement#"][Play #@#Sounds\MSVolume.wav][!Update]
MouseScrollUpAction=[!CommandMeasure "MeasureWin7Audio" "ChangeVolume +#VolumeIncrement#"][Play #@#Sounds\MSVolume.wav][!Update]

[MeterVolumeBar]
Meter=Bar
MeasureName=MeasureWin7Audio
X=10
Y=10
W=200
H=10
BarColor=161,232,139,255
SolidColor=150,150,150,255
BarOrientation=Horizontal

[MeterVolumeLabel]
Meter=String
X=0r
Y=2R
FontFace=Segoe UI
FontSize=12
FontColor=255,255,255,255
StringStyle=Bold
AntiAlias=1
Text=Volume:

[MeterVolumeText]
Meter=String
X=2R
Y=0r
FontFace=Segoe UI
FontSize=12
FontColor=200,250,185,255
StringStyle=Bold
Text=[MeasureWin7Audio:]%
AntiAlias=1
DynamicVariables=1

[MeterVolumeIcon]
Meter=Image
X=185
Y=3r
W=16
H=16
LeftMouseUpAction=[!CommandMeasure "MeasureWin7Audio" "ToggleMute"][Play #@#Sounds\MSVolume.wav][!Update]
Post Reply