It is currently July 11th, 2020, 12:20 am

Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down [solved]

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 11004
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by balala »

Mor3bane wrote:
January 25th, 2020, 2:55 pm
The ahk file is in the @Resources folder - it is being recognised but that only means it is not a simple focus issue - something is breaking this when I click to another display the return to mouseover, left or right click on the blackout does nothing then.
As I said above, this definitely is a ClickThrough problem.
Additionally note that in the posted package the included image is named Fifty.png, but in the cod is used as Image.png. Can't work!
User avatar
Mor3bane
Posts: 856
Joined: May 7th, 2016, 7:32 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Mor3bane »

balala wrote:
January 25th, 2020, 3:27 pm
As I said above, this definitely is a ClickThrough problem.
Additionally note that in the posted package the included image is named Fifty.png, but in the cod is used as Image.png. Can't work!
Please look at my new rmskin in my last post. I've attached it. It works but it stops working when I click off on another monitor. When I click on the manager window it works but if i click away it stops. That is a broken skin. I've tried everything to the best of my understanding with no change in functionality.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that is requires luck to achieve.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4040
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by eclectic-tech »

@mor3bane

Once you set a skin's 'ClickThrough' setting to 1, there is no way to avoid having to hold the 'Ctrl' key to access the skin.

Here is a version of your code modified to do most of what you have described. I do not have multiple monitors, so you may have to tweak it for that use.

One of the main differences is besides 'Setting', I also 'Write' changes to the 'Alpha' and 'ClickThroughEnabled' variables, so they are remembered.
I added a few comments in the code for reminders of what is happening.

Once loaded, hold the 'Ctrl' key and left click anywhere. You can scroll to control the brightness. Left click again anywhere to be able to access the items on the desktop. To readjust the brightness or unload the skin, hold the 'Ctrl' key and left click anywhere to establish access to the skin.

As I said, once the skin is in ClickThrough mode, you MUST hold 'Ctrl' to be able to access it's features.

Try this and let us know if it is what you wanted.

Code: Select all

[Rainmeter]
Update=500
DefaultAutoSelectScreen=1

; You may need to add a !Move bang to ensure it is at the top-left of the desired monitor
OnRefreshAction=[!ClickThrough #ClickThroughEnabled#][!Zpos 2]

[Variables]
Alpha=0
ClickThroughEnabled=1

[MeterImage]
Meter=Image
ImageName=#@#Fifty
ImageAlpha=#Alpha#
X=0
Y=0

; Set the size of the image to the current monitor size. I do not have multiple monitors, so you may need to adjust this and also the 'DefaultAutoSelectScreen=1' in the [Rainmeter] section for it to work on all screens 
W=#ScreenAreaWidth#
H=#ScreenAreaHeight#

; Set the Alpha variable vai scroll action and write it to [Variables] so it is remembered when refreshed
MouseScrollDownAction=[!WriteKeyValue Variables Alpha "(Clamp(#Alpha#+25.5,0,255))"][!SetVariable Alpha "(Clamp(#Alpha#+25.5,0,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseScrollUpAction=[!WriteKeyValue Variables Alpha "(Clamp(#Alpha#-25.5,0,255))"][!SetVariable Alpha "(Clamp(#Alpha#-25.5,0,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
SolidColor=0,0,0,1

; Toggles the skin's ClickThrough
; When you load the skin, it is set to ClickThrough
; You MUST to hold the 'Ctrl' key down  to be able to click and toggle the skins ClickThrough setting.
; If you can not scroll to set the dimness, then you are in ClickThrough mode, and MUST hold the 'Ctrl' key to access the toggle
; No way around this since the skin will not respond while 'ClickThroughEnabled=1'
LeftMouseUpAction=[!WriteKeyValue Variables ClickThroughEnabled "(1-#ClickThroughEnabled#)"][!Refresh]

DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 11004
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by balala »

Mor3bane wrote:
January 25th, 2020, 3:32 pm
Please look at my new rmskin in my last post. I've attached it. It works but it stops working when I click off on another monitor. When I click on the manager window it works but if i click away it stops. That is a broken skin. I've tried everything to the best of my understanding with no change in functionality.
EDIT: Sorry eclectic-tech, you beat me this time. Again.

You mean this one? If so, yep, I tried it and described that if using the Clickthrough it won't even work. I have one single monitor, so I can't check what's going on when there are two (or more), but I suppose when you click it sets to click through and that's why it stops working. Try to keep holding CTRL and scroll. This overrides the Clickthrough.
User avatar
Mor3bane
Posts: 856
Joined: May 7th, 2016, 7:32 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Mor3bane »

Thanks - I don't really know why click-through has to be an issue - unless it is a default state somehow. I mentioned it initially, but was happy to abandon the notion in view of the scroll dimming working.

eclectic-tech
I tried your code and holding the ctrl key does nothing. I know the skin is loaded since I have the 'touch' pointer when over it.

It MUST be something unique to my set up??
I am always running DisplayFusion
I am using a custom theme where the win10 environment is very graphical using .msstyles

So not being able to say what is wrong, but this seems to be one of those things that sometimes wont work on a given system?
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that is requires luck to achieve.
User avatar
Mor3bane
Posts: 856
Joined: May 7th, 2016, 7:32 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Mor3bane »

eclectic-tech wrote:
January 25th, 2020, 4:47 pm
@mor3bane

Once you set a skin's 'ClickThrough' setting to 1, there is no way to avoid having to hold the 'Ctrl' key to access the skin.

Here is a version of your code modified to do most of what you have described. I do not have multiple monitors, so you may have to tweak it for that use.

One of the main differences is besides 'Setting', I also 'Write' changes to the 'Alpha' and 'ClickThroughEnabled' variables, so they are remembered.
I added a few comments in the code for reminders of what is happening.

Once loaded, hold the 'Ctrl' key and left click anywhere. You can scroll to control the brightness. Left click again anywhere to be able to access the items on the desktop. To readjust the brightness or unload the skin, hold the 'Ctrl' key and left click anywhere to establish access to the skin.

As I said, once the skin is in ClickThrough mode, you MUST hold 'Ctrl' to be able to access it's features.

Try this and let us know if it is what you wanted.

Code: Select all

[Rainmeter]
Update=500
DefaultAutoSelectScreen=1

; You may need to add a !Move bang to ensure it is at the top-left of the desired monitor
OnRefreshAction=[!ClickThrough #ClickThroughEnabled#][!Zpos 2]

[Variables]
Alpha=0
ClickThroughEnabled=1

[MeterImage]
Meter=Image
ImageName=#@#Fifty
ImageAlpha=#Alpha#
X=0
Y=0

; Set the size of the image to the current monitor size. I do not have multiple monitors, so you may need to adjust this and also the 'DefaultAutoSelectScreen=1' in the [Rainmeter] section for it to work on all screens 
W=#ScreenAreaWidth#
H=#ScreenAreaHeight#

; Set the Alpha variable vai scroll action and write it to [Variables] so it is remembered when refreshed
MouseScrollDownAction=[!WriteKeyValue Variables Alpha "(Clamp(#Alpha#+25.5,0,255))"][!SetVariable Alpha "(Clamp(#Alpha#+25.5,0,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseScrollUpAction=[!WriteKeyValue Variables Alpha "(Clamp(#Alpha#-25.5,0,255))"][!SetVariable Alpha "(Clamp(#Alpha#-25.5,0,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
SolidColor=0,0,0,1

; Toggles the skin's ClickThrough
; When you load the skin, it is set to ClickThrough
; You MUST to hold the 'Ctrl' key down  to be able to click and toggle the skins ClickThrough setting.
; If you can not scroll to set the dimness, then you are in ClickThrough mode, and MUST hold the 'Ctrl' key to access the toggle
; No way around this since the skin will not respond while 'ClickThroughEnabled=1'
LeftMouseUpAction=[!WriteKeyValue Variables ClickThroughEnabled "(1-#ClickThroughEnabled#)"][!Refresh]

DynamicVariables=1
Hey, Hi.
This actually works - so far - I was inadvertently loading a defunct Layout.
Now that my Layouts match the skin arrangement, all is good in the Mor3bane world.

Thanks to both eclectic-tech & balala for your perserverance in assistin me get this layout happening - I could not have done it without logic assistance. :rosegift: :thumbup: :great:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that is requires luck to achieve.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4040
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down [solved]

Post by eclectic-tech »

Happy to help.
User avatar
balala
Rainmeter Sage
Posts: 11004
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by balala »

Mor3bane wrote:
January 25th, 2020, 10:23 pm
I don't really know why click-through has to be an issue
Because when a skin is set to click-through, the skin loses the possibility to detect mouse actions (clicks for instance).