It is currently April 25th, 2024, 4:51 pm

Rainmeter giving a visual indicator when Caps-lock is enabled?

Get help with creating, editing & fixing problems with skins
WirlyWirly
Posts: 17
Joined: July 15th, 2020, 6:37 am

Rainmeter giving a visual indicator when Caps-lock is enabled?

Post by WirlyWirly »

I'm curious if there's a way for rainmeter to display an on-top image/notification in the corner of my screen when caps-lock is enabled.

I use the vim editor all-day long, which as any user will tell you doesn't play well with caps-lock enabled. The current standard is to remap the key so that it is instead <Esc>, <Ctrl>, etc.

I however find the key to be very useful, and don't want to get accustomed to keyboard layouts that only work on my personal computer, so I'd like to keep it as-is, but with some kind of visual indicator that I have it on. My keyboard has an indicator light, however I never look down there so I really have no idea what's going on. It's not until vim loses its mind that I realize I left caps-lock on.

Anyone have any suggestions for how I can get this to work? At the speed I move between enabled/disabled, as-well as the monitoring it would have to do when idle, I'm pretty sure the refresh rate for a meter would have to be very quick to keep up with it, which would put a toll on my cpu. Still thought I'd ask though.
Last edited by WirlyWirly on August 3rd, 2020, 5:19 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter giving a visual indicator when Caps-lock is enabled?

Post by jsmorley »

WirlyWirly wrote: August 3rd, 2020, 5:14 pm I'm curious is there's a way for rainmeter to display an on-top image/notification in the corner of my screen when caps-lock is enabled.

I use the vim editor all-day long, which as any user will tell you doesn't play well with caps-lock enabled. The current standard is to remap the key so that it is instead <Esc>, <Ctrl>, etc.

I however find the key to be very useful, so I'd like to keep it as-is, but with some kind of visual indicator that I have it on. My keyboard has an indicator light, however I never look down there so I really have no idea what's going on. It's not until vim loses its mind that I realize I left caps-lock on.

Anyone have any suggestions for how I can get this to work? At the speed I move between enabled/disabled, I'm pretty sure the refresh rate for a meter would have to be very quick to keep up with it, which would put a toll on my cpu. Still thought I'd ask though.

KeyState_1.0.rmskin

1.jpg

Code: Select all

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

[Metadata]
Name=KeyState
Author=JSMorley
Information=Demonstration of the KeyState.dll plugin for Rainmeter.||Valid values for option KeyName=|CAPS|NUM|SCROLL||Plugin returns 1 if the key is "locked" and 0 if not.||Plugin .dll files for x32 and x64 are contained in the skin folder for use in distribution of your own .rmskin.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Dec 17, 2013

[MeasureCAPS]
Measure=Plugin
Plugin=KeyState
KeyName=CAPS
IfEqualValue=0
IfEqualAction=[!SetOption MeterCAPS ImageName "OffLight.png"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetOption MeterCAPS ImageName "RedLight.png"][!UpdateMeter *][!Redraw]

[MeasureNUM]
Measure=Plugin
Plugin=KeyState
KeyName=NUM
IfEqualValue=0
IfEqualAction=[!SetOption MeterNUM ImageName "OffLight.png"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetOption MeterNUM ImageName "RedLight.png"][!UpdateMeter *][!Redraw]

[MeasureSCROLL]
Measure=Plugin
Plugin=KeyState
KeyName=SCROLL
IfEqualValue=0
IfEqualAction=[!SetOption MeterSCROLL ImageName "OffLight.png"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetOption MeterSCROLL ImageName "RedLight.png"][!UpdateMeter *][!Redraw]

[MeterBackGround]
Meter=Image
W=156
H=26
SolidColor=47,47,47,255

[MeterCAPSText]
Meter=String
X=7
Y=5
FontFace=Trebuchet MS
FontSize=10
FontColor=255,250,232
StringStyle=Bold
AntiAlias=1
Text=CAP

[MeterCAPS]
Meter=Image
ImagePath=#@#Images\
X=3R
Y=1r
W=15
H=15

[MeterNUMText]
Meter=String
X=7R
Y=5
FontFace=Trebuchet MS
FontSize=10
FontColor=255,250,232
StringStyle=Bold
AntiAlias=1
Text=NUM

[MeterNUM]
Meter=Image
ImagePath=#@#Images\
X=3R
Y=1r
W=15
H=15

[MeterSCROLLText]
Meter=String
X=7R
Y=5
FontFace=Trebuchet MS
FontSize=10
FontColor=255,250,232
StringStyle=Bold
AntiAlias=1
Text=SCR

[MeterSCROLL]
Meter=Image
ImagePath=#@#Images\
X=3R
Y=1r
W=15
H=15
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter giving a visual indicator when Caps-lock is enabled?

Post by jsmorley »

You can reduce Update to as low as 16 if you want. This shouldn't be a big hit to your CPU.
WirlyWirly
Posts: 17
Joined: July 15th, 2020, 6:37 am

Re: Rainmeter giving a visual indicator when Caps-lock is enabled?

Post by WirlyWirly »

Perfect! Works beautifully, especially with "StayTopmost". Going to be super useful going forward. Thanks a bunch!

Code: Select all

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

[Metadata]
Name=KeyState
Author=JSMorley
Information=Demonstration of the KeyState.dll plugin for Rainmeter.||Valid values for option KeyName=|CAPS|NUM|SCROLL||Plugin returns 1 if the key is "locked" and 0 if not.||Plugin .dll files for x32 and x64 are contained in the skin folder for use in distribution of your own .rmskin.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Dec 17, 2013

[MeasureCAPS]
Measure=Plugin
Plugin=KeyState
KeyName=CAPS
IfEqualValue=0
IfEqualAction=[!SetOption MeterCAPS ImageTint "0,0,0,0"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetOption MeterCAPS ImageTint "255,255,255,255"][!UpdateMeter *][!Redraw]

[MeterCAPS]
Meter=Image
ImageName=#@#\Images\capslock.png
Last edited by WirlyWirly on August 3rd, 2020, 5:49 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter giving a visual indicator when Caps-lock is enabled?

Post by jsmorley »

WirlyWirly wrote: August 3rd, 2020, 5:48 pm Perfect! Works beautifully! Going to be super useful going forward. Thanks a bunch!

Code: Select all

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

[Metadata]
Name=KeyState
Author=JSMorley
Information=Demonstration of the KeyState.dll plugin for Rainmeter.||Valid values for option KeyName=|CAPS|NUM|SCROLL||Plugin returns 1 if the key is "locked" and 0 if not.||Plugin .dll files for x32 and x64 are contained in the skin folder for use in distribution of your own .rmskin.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Dec 17, 2013

[MeasureCAPS]
Measure=Plugin
Plugin=KeyState
KeyName=CAPS
IfEqualValue=0
IfEqualAction=[!SetOption MeterCAPS ImageTint "0,0,0,0"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetOption MeterCAPS ImageTint "255,255,255,255"][!UpdateMeter *][!Redraw]

[MeterCAPS]
Meter=Image
ImageName=#@#\Images\capslock.png
Glad to help.