It is currently April 19th, 2024, 5:09 pm

Super quick execution with hotspots

Tips and Tricks from the Rainmeter Community
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Super quick execution with hotspots

Post by kenz0 »

Image

This is a tricks that utilize MouseOverAction as "Hotspots" on a desktop.
You can quickly execute allocated commands by touching each hotspots with the mouse cursor.

___________________________________

Here is the snippet of config which arranged 8 hotspots to a desktop area.

[Snippets.inc]

Code: Select all

[Variables]
SpotSizeCorner=8
SpotSizeSideLength=800
SpotSizeSideDepth=2
ReleaseDepth=2
SpotColor=255,0,0,1
ReleaseColor=0,255,255,1

[Rainmeter]
Update=86400000
OnRefreshAction=!Execute [!RainmeterMove #SCREENAREAX# #SCREENAREAY#][!RainmeterZPos 2]

; Release Sections ==============
; (These sections are Workaround for MouseLeaveAction issue)

[MeterRelease_TopLeft]
Meter=IMAGE
X=0
Y=0
W=(#SpotSizeCorner#+#ReleaseDepth#)
H=(#SpotSizeCorner#+#ReleaseDepth#)
SolidColor=#ReleaseColor#

[MeterRelease_TopSide]
Meter=IMAGE
X=((#SCREENAREAWIDTH#/2)-(#SpotSizeSideLength#/2))
Y=0
W=#SpotSizeSideLength#
H=(#SpotSizeSideDepth#+#ReleaseDepth#)
SolidColor=#ReleaseColor#

[MeterRelease_TopRight]
Meter=IMAGE
X=(#SCREENAREAWIDTH#-(#SpotSizeCorner#+#ReleaseDepth#))
Y=0
W=(#SpotSizeCorner#+#ReleaseDepth#)
H=(#SpotSizeCorner#+#ReleaseDepth#)
SolidColor=#ReleaseColor#

[MeterRelease_LeftSide]
Meter=IMAGE
X=0
Y=((#SCREENAREAHEIGHT#/2)-(#SpotSizeSideLength#/2))
W=(#SpotSizeSideDepth#+#ReleaseDepth#)
H=#SpotSizeSideLength#
SolidColor=#ReleaseColor#

[MeterRelease_RightSide]
Meter=IMAGE
X=(#SCREENAREAWIDTH#-(#SpotSizeSideDepth#+#ReleaseDepth#))
Y=((#SCREENAREAHEIGHT#/2)-(#SpotSizeSideLength#/2))
W=(#SpotSizeSideDepth#+#ReleaseDepth#)
H=#SpotSizeSideLength#
SolidColor=#ReleaseColor#

[MeterRelease_BottomLeft]
Meter=IMAGE
X=0
Y=(#SCREENAREAHEIGHT#-(#SpotSizeCorner#+#ReleaseDepth#))
W=(#SpotSizeCorner#+#ReleaseDepth#)
H=(#SpotSizeCorner#+#ReleaseDepth#)
SolidColor=#ReleaseColor#

[MeterRelease_BottomSide]
Meter=IMAGE
X=((#SCREENAREAWIDTH#/2)-(#SpotSizeSideLength#/2))
Y=(#SCREENAREAHEIGHT#-(#SpotSizeSideDepth#+#ReleaseDepth#))
W=#SpotSizeSideLength#
H=(#SpotSizeSideDepth#+#ReleaseDepth#)
SolidColor=#ReleaseColor#

[MeterRelease_BottomRight]
Meter=IMAGE
X=(#SCREENAREAWIDTH#-(#SpotSizeCorner#+#ReleaseDepth#))
Y=(#SCREENAREAHEIGHT#-(#SpotSizeCorner#+#ReleaseDepth#))
W=(#SpotSizeCorner#+#ReleaseDepth#)
H=(#SpotSizeCorner#+#ReleaseDepth#)
SolidColor=#ReleaseColor#

; HotSpot Sections ==============

[MeterSpot_TopLeft]
Meter=IMAGE
X=0
Y=0
W=#SpotSizeCorner#
H=#SpotSizeCorner#
SolidColor=#SpotColor#
MouseOverAction=#TopLeft#

[MeterSpot_TopSide]
Meter=IMAGE
X=((#SCREENAREAWIDTH#/2)-(#SpotSizeSideLength#/2))
Y=0
W=#SpotSizeSideLength#
H=#SpotSizeSideDepth#
SolidColor=#SpotColor#
MouseOverAction=#TopSide#

[MeterSpot_TopRight]
Meter=IMAGE
X=(#SCREENAREAWIDTH#-#SpotSizeCorner#)
Y=0
W=#SpotSizeCorner#
H=#SpotSizeCorner#
SolidColor=#SpotColor#
MouseOverAction=#TopRight#

[MeterSpot_LeftSide]
Meter=IMAGE
X=0
Y=((#SCREENAREAHEIGHT#/2)-(#SpotSizeSideLength#/2))
W=#SpotSizeSideDepth#
H=#SpotSizeSideLength#
SolidColor=#SpotColor#
MouseOverAction=#LeftSide#

[MeterSpot_RightSide]
Meter=IMAGE
X=(#SCREENAREAWIDTH#-#SpotSizeSideDepth#)
Y=((#SCREENAREAHEIGHT#/2)-(#SpotSizeSideLength#/2))
W=#SpotSizeSideDepth#
H=#SpotSizeSideLength#
SolidColor=#SpotColor#
MouseOverAction=#RightSide#

[MeterSpot_BottomLeft]
Meter=IMAGE
X=0
Y=(#SCREENAREAHEIGHT#-#SpotSizeCorner#)
W=#SpotSizeCorner#
H=#SpotSizeCorner#
SolidColor=#SpotColor#
MouseOverAction=#BottomLeft#

[MeterSpot_BottomSide]
Meter=IMAGE
X=((#SCREENAREAWIDTH#/2)-(#SpotSizeSideLength#/2))
Y=(#SCREENAREAHEIGHT#-#SpotSizeSideDepth#)
W=#SpotSizeSideLength#
H=#SpotSizeSideDepth#
SolidColor=#SpotColor#
MouseOverAction=#BottomSide#

[MeterSpot_BottomRight]
Meter=IMAGE
X=(#SCREENAREAWIDTH#-#SpotSizeCorner#)
Y=(#SCREENAREAHEIGHT#-#SpotSizeCorner#)
W=#SpotSizeCorner#
H=#SpotSizeCorner#
SolidColor=#SpotColor#
MouseOverAction=#BottomRight#
__________________________________________

The following is a various examples for useful usage.
Use it with above snippet using @Include

[Change State of all skins]
  • Top Left = Show all skins
  • Top Right = Hide all skins
  • Bottom Left = Change Transparency of all skins to 0%
  • Bottom Right = Change Transparencyof all skins to 70%

Code: Select all

[Variables]
TopLeft=!RainmeterShowFade *
TopSide=
TopRight=!Execute [!RainmeterHideFade *][!RainmeterShow Hotspots]
LeftSide=
RightSide=
BottomLeft=!RainmeterSetTransparency 255 *
BottomSide=
BottomRight=!RainmeterSetTransparency 75 *

[Rainmeter]
@Include=#CURRENTPATH#Snippets.inc
[Control Winamp]
  • Top Left =Volume Down
  • Top Side = Pause
  • Top Right = Volume Up
  • Left Side = Previous Track
  • Right Side = Next Track

Code: Select all

[Variables]
TopLeft=!RainmeterPluginBang "MeasureWinamp SendMessage 273 40352 0"
TopSide=!RainmeterPluginBang "MeasureWinamp SendMessage 273 40046 0"
TopRight=!RainmeterPluginBang "MeasureWinamp SendMessage 273 40351 0"
LeftSide=!RainmeterPluginBang "MeasureWinamp SendMessage 273 40044 0"
RightSide=!RainmeterPluginBang "MeasureWinamp SendMessage 273 40048 0"
BottomLeft=
BottomSide=
BottomRight=

[Rainmeter]
@Include=#CURRENTPATH#Snippets.inc

; Winamp Control ========================

[MeasureWinamp]
Measure=Plugin
Plugin=Plugins\WindowMessagePlugin.dll
WindowClass=Winamp v1.x
[Application Launcher]
  • Top Left = Run Notepad
  • Top Right = Run Explorer
  • Bottom Left = Run Browser
  • Bottom Right = Run iTunes

Code: Select all

[Variables]
TopLeft=!Execute [notepad.exe]
TopSide=
TopRight=!Execute [explorer.exe]
LeftSide=
RightSide=
BottomLeft=!Execute [http://google.com/]
BottomSide=
BottomRight=!Execute [iTunes.exe]

[Rainmeter]
@Include=#CURRENTPATH#Snippets.inc
[Handy Windows Commands]
  • Top Left = Shows Desktop
  • Top Right = Window Switcher
  • Bottom Left = Run
  • Bottom Right = Task Manager

Code: Select all

[Variables]
TopLeft=!Execute ["%APPDATA%\Microsoft\Internet Explorer\Quick Launch\Shows Desktop.lnk"]
TopSide=
TopRight=!Execute ["%APPDATA%\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnk"]
LeftSide=
RightSide=
BottomLeft=!Execute [%windir%\system32\rundll32.exe shell32.dll,#61]
BottomSide=
BottomRight=!Execute [taskmgr]

[Rainmeter]
@Include=#CURRENTPATH#Snippets.inc
______________________________________

The above examples is just a EXAMPLE. So you should define the best commands into "My_Commands.ini", in order to realize practical use.

Download Example Configs

I hope this information helps you.

______________________________________

Notes:
  • This requires Rainmeter-1.2-beta or higher
  • Snippet.inc is based on the assumption that "desktop area" is desktop of primary monitor.
  • You can change hotspot size by changing the value under the [Variables] on the Snippet.inc if you need. But it's important to note that hotspot always stays on at the top z-position so if hotspot size is too big, it might become the obstacle of other operations.
  • If you want to check the hotspot size, change value of "SpotColor" and "ReleaseColor".
.
Image
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Super quick execution with hotspots

Post by dragonmage »

Nice work Kenz0! I did something like this a while back just as proof of concept, but never took the time to flesh it out like this. I'm sure people will find it useful.
User avatar
Dave_W
Posts: 37
Joined: April 20th, 2009, 10:58 am

Re: Super quick execution with hotspots

Post by Dave_W »

I've just realised that when I bookmark something for later reference, I probably forget to give it the appropriate kudos (because by the time I get round to using it, the thread is so low that I don't want to bump it).

So - kudos! This looks like a great concept, as close as I've seen to something that increases the functionality of Rainmeter without being a new build.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Super quick execution with hotspots

Post by JpsCrazy »

I've had this for awhile, but never got around to using it till I was forced to use my older computer for awhile and redid everything Rainmeter.

Anywho, this first thing I noticed when using it was that anything that was autohid I couldn't get to because of this skin, including my taskbar.
Simply enough, I just set the skin to 'Click Through' and it was fine.
Also consider turning off 'Draggable', that'd probably cause problems if it wasn't on the edge of the screen.
Just in case anyone else runs into a similar problem.
BrainStabber
Posts: 3
Joined: June 12th, 2010, 11:38 pm

Re: Super quick execution with hotspots

Post by BrainStabber »

Great work and explanation Kenzo! I've been doing something similar so I just wanted to add some of what I do to show the diversity of this idea:

1) Use !RainmeterZPos instead of !RainmeterShow/Hide - I like to have most of my skins on the desktop instead of hidden, so instead I use !RainmeterZPos to alternate a skin's visibility.

2) Use LeftMouseDownAction and LeftMouseUpAction instead of MouseOver/MouseLeave - I've had trouble with MouseOver/MouseLeave not switching states if I move my mouse too fast. Instead I use a use a mouse click. For me this has an added benefit. Combined with changing the Z-position, I can make a skin stay visible! Some of my work requires a lot of CPU usage, so occasionally I want my skin that shows what my top process/CPU/RAM usage to be set to TopMost. To do this, I just click on my hotspot while still holding down the mouse button. Then I move the mouse cursor off of the skin and release it. Now the skin stays TopMost as long as I want. To send it back to the desktop, I just click the hotspot again, but I make sure to release the mouse button while the cursor is still over the skin (~15x15 pixels).

3) Have multiple skins to toggle the visibility - I have a side bar on the left and another on the right, each of which contain different types of info, e.g. CPU/battery/network on the left and feeds/weather/gmail on the right. By creating multiple skins (e.g. 2 folders with their own skins: ZToggle>LeftCorner and ZToggle>RightCorner) to control visibility, I choose what I want to see and what can remain on the desktop.

4) Add additional mouse actions - I use RightMouseUpAction to launch RainBrowser because I'm always testing an changing Rainmeter stuff, but this can be used to implement any of Kenzo's other great ideas like play/pause winamp, open explorer, etc.

5) If showing several skins, add a background bar - I use a semitransparent gradient behind the skins I ZToggle to help them display and frame them. NOTE: If you do this, then on the MouseUpAction the bar should be placed LAST in your code (see me example). If not, you may observe your skins flashing because of a conflict between the Z-Position of the bar and the skins that occupy the same pixel space. Additionally, within Rainmeter.ini (or via RainBrowser) I set the load order of the bar to be less than that of the other skins so that it loads before/closer to the desktop than other skins.

To say the least, when using hotspots, the possibilities are very diverse. For example, you could mix and match using a MouseOver/Leave in the TopLeftCorner and a MouseUp/Down in the TopRightCorner.

Code: Select all

[Rainmeter]
Author=BrainStabber
Update=86400000
AppVersion=1000000



[Metadata]
Name=Cogitate Toggle Z-Position of Skins (Left)
Config=Simplicity | Toggle Z | ToggleZ_Left
Description=Button for toggling the z-position of skins between the Desktop and TopMost
Instructions=Left click then BOOM and stuff shows up. Left click then HUH? and stuff disappears. | Right click loads RainBrowser.
Version=2.0
Tags=Button | Toggle Z | Left
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0



[Variables]
@Include=..\..\SETTINGS\Variables.inf
skin1="Cogitate\Bars\Left Bar"
skin2=Cogitate\System
skin3=Cogitate\Battery
skin4="Cogitate\Recycle Bin"
;skin5=Cogitate\Uptime
;skin6=Cogitate\



[MeterButton]
Meter=Image
X=0
Y=0
W=15
H=15
SolidColor=#color.Black#,#opacity.Max#
SolidColor2=#color.White#,#opacity.Min#
GradientAngle=45
;------ BUTTON ACTIONS ------
LeftMouseDownAction=!Execute [!RainmeterZPos 1 "#skin1#"][!RainmeterZPos 1 "#skin2#"][!RainmeterZPos 1 "#skin3#"][!RainmeterZPos 1 "#skin4#"][!RainmeterRedraw]

LeftMouseUpAction=!Execute [!RainmeterZPos -2 "#skin2#"][!RainmeterZPos -2 "#skin3#"][!RainmeterZPos -2 "#skin4#"][!RainmeterZPos -2 "#skin1#"][!RainmeterRedraw]

RightMouseUpAction=!Execute ["#PROGRAMPATH#Addons\RainBrowser\RainBrowser.exe"][!RainmeterRedraw]

MiddleMouseUpAction=!Execute [opperationAwwCrap.exe][!RainmeterRedraw]
Good Luck