It is currently May 6th, 2024, 10:58 am

Can I specify a meter to 'Click Through'?

Get help with creating, editing & fixing problems with skins
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Can I specify a meter to 'Click Through'?

Post by sl23 »

I have a screen saver background shape meter. But wanted to add some buttons to adjust colour and opacity.
After some time I realised why the buttons don't react, I had the screen saver skin set to ClickThrough! :? :lol:

So I wondered if it were possible to set a meter within a skin to not react to any Mouse actions and be set to ClickThrough same as a skin can. This would allow me to add buttons to this skin that react Mouse actions, but allow the background itself to remain completely passive.

Can it be done? Or do I need to create a new skin and edit the existing screensaver skin through bangs in this new 'button' skin?

Thanks for any help :thumbup:

Current code:

Code: Select all

[Variables]
BgFill=0,0,0,150
White20=255,255,255,20
White60=255,255,255,60
Yellow=255,255,0

[Background]
Meter=Shape
Shape=Rectangle 0,0,#ScreenAreaWidth#,#WorkAreaHeight#,0 | Extend FillAlpha
FillAlpha=FillColor 0,0,0,210
DynamicVariables=1

[Button1]
Meter=Shape
Shape=Ellipse 0,0,10 | FillColor #BgFill# | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=StrokeColor #White60#

LeftMouseUpAction=[!SetOption Background FillAlpha "FillColor 150,150,0,210"]

MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #Yellow#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #White60#"][!UpdateMeter *][!Redraw]

DynamicVariables=1
X=50
Y=100

[Button2]
Meter=Shape
Shape=Ellipse 0,0,10 | FillColor #BgFill# | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=StrokeColor #White60#

LeftMouseUpAction=[!SetOption Background FillAlpha "FillColor 200,200,0,210"]

MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #Yellow#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #White60#"][!UpdateMeter *][!Redraw]

DynamicVariables=1
X=r
Y=30r
- MuLab -
User avatar
CodeCode
Posts: 1367
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can I specify a meter to 'Click Through'?

Post by CodeCode »

Hi,
Well if your buttons and such are shape meters, then the solution is fairly easy, since shape meters can be any shape and only have the space inside to be clickable.
If you want to use images, then the next step would be to creating nearly invisible shape meters over the pictures to take advantage of that same rule.

This should allow you to define any mouse action for any shape or also images.

IfTrueAction=[!SetOption ButtonMainOneF LeftMouseUpAction """[!CommandMeasure Measure "Run"]"""][!Update] This also helps youi top define or limit where mouse actions can be used with nearly any circumstance in conditional situations.

Another example of inline ecripting mouse actions:
[!SetVariable State """[!DisableMouseActionGroup "LeftMouseUpAction|RightMouseUpAction" Texts]"""][!Update]

You can even define multiple actions:
[!SetOption ButtonMain LeftMouseUpAction """[!CommandMeasure MeasureTop "Run"][!CommandMeasure MeasureClick "Run"]"""][!Update]
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Can I specify a meter to 'Click Through'?

Post by sl23 »

Thanks for your reply CodeCode :thumbup:

I think you misunderstood the intent though.

The main background covers the desktop area, so that means it needs to be set to Click Through.
The trouble is, adding buttons to this skin means they don't react as you can't click on them. So I am asking if it is possible to set a Meter as Click Through, rather than the whole skin, so as to allow the buttons to function correctly. Or a workaround if possible :D

This skin only has Shape Meters and measures nothing, so the IfTrueAction has no context for it to work.
- MuLab -
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Can I specify a meter to 'Click Through'?

Post by eclectic-tech »

ClickThrough affects the entire skin; it is not possible to change this for individual meters.

Generally, you will need to make a separate skin for control of a Clickthrough skin.

Rube Goldberg Option

Code: Select all

[Variables]
ClickThru=0

[Rainmeter]
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

OnRefreshAction=[!ClickThrough "#Clickthru#"]

; =====================================
; ======== Skin Context Menu ==========
; =====================================
RightMouseUpAction=[!SkinCustomMenu]

ContextTitle="Toggle 'Click-Thru'"
ContextAction=[!WriteKeyValue Variables ClickThru (1-#ClickThru#)][!Refresh]

...
Create a new variable called 'ClickThru' and a Context menu action to toggle its value "0~1'.
By using 'Ctrl+RightMouse' you can override clickthrough and bring up the skin context menu where you can change the variable and refresh to toggle click through.
User avatar
CodeCode
Posts: 1367
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can I specify a meter to 'Click Through'?

Post by CodeCode »

sl23 wrote: February 11th, 2023, 1:23 pm Thanks for your reply CodeCode :thumbup:

I think you misunderstood the intent though.

The main background covers the desktop area, so that means it needs to be set to Click Through.
The trouble is, adding buttons to this skin means they don't react as you can't click on them. So I am asking if it is possible to set a Meter as Click Through, rather than the whole skin, so as to allow the buttons to function correctly. Or a workaround if possible :D

This skin only has Shape Meters and measures nothing, so the IfTrueAction has no context for it to work.
Just for example

You can create a measure that is triggered by your mouse action, and defines a simple binary zero or one - then the measure can do its preferred thing for the meter/s.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Can I specify a meter to 'Click Through'?

Post by sl23 »

Thanks for the replies. I'll give the menu option a try when I get a chance. It seems the best option for what I need. :thumbup:
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Can I specify a meter to 'Click Through'?

Post by sl23 »

Haven't had time to look at this yet, but just thought I'd point out that the ctrl + right click seems to be an issue. Not sure if it's my system, Rainmeter or the fact the shape covers the desktop.

But it takes several clicks to bring up the context menu. Sometimes up to ten clicks before it appears! Is it a bug?
- MuLab -
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Can I specify a meter to 'Click Through'?

Post by eclectic-tech »

sl23 wrote: February 14th, 2023, 7:30 am Haven't had time to look at this yet, but just thought I'd point out that the ctrl + right click seems to be an issue. Not sure if it's my system, Rainmeter or the fact the shape covers the desktop.

But it takes several clicks to bring up the context menu. Sometimes up to ten clicks before it appears! Is it a bug?
I have not experienced that issue. I used this method in several full screen skins and only once or twice does it take more than a single "hold Ctrl and right-click" to bring up the context menu. :???:

Can you post an example of your code that exhibits this behavior?
User avatar
CodeCode
Posts: 1367
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can I specify a meter to 'Click Through'?

Post by CodeCode »

Yes, I found this as well with my multi dim skin.
If the desktop was available through the dimmed 1920 x 1080 transparency, and using a mouse combination to access what was below, then the clicking on the dimmer was sporadic.
If there was no clickable space below the mouse, then the ctrl-click seemed to work fine.
I did not find a workaround though.
Instead, I thought to try reorganizing the mouse actions, possibly with the HotKey plugin. But have not gotten into that as my own usage changed before I made that solution absolutely necessary.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Can I specify a meter to 'Click Through'?

Post by eclectic-tech »

CodeCode wrote: February 14th, 2023, 12:18 pm Yes, I found this as well with my multi dim skin.
If the desktop was available through the dimmed 1920 x 1080 transparency, and using a mouse combination to access what was below, then the clicking on the dimmer was sporadic.
If there was no clickable space below the mouse, then the ctrl-click seemed to work fine.
I did not find a workaround though.
Instead, I thought to try reorganizing the mouse actions, possibly with the HotKey plugin. But have not gotten into that as my own usage changed before I made that solution absolutely necessary.
If this has been your experiences, then I would suggest using the HotKey plugin, as Cocdecode suggests:

Code: Select all

[OpenContext]
Measure=Plugin
Plugin=Hotkey
HotKey=CTRL RBUTTON
KeyDownAction=[!SkinMenu]