Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 27

Community Plugins & Addons • Re: KeyCodeInfo

$
0
0
Hey nstechbytes, thank you for this. Not sure if you made it after I asked about it the other day, anyways thank you so much. This is pretty close to what I'm looking for!.

I've been testing it for the past hour and I'm pretty happy with it.

However, I do see a couple things missing that I'm not sure if are possible to be added :oops:

One is the ability to get key combinations in other formats apart from the "friendly format". The thing is that, while the friendly format is great to be shown to the user, it's practically unusable on plugins like hotkey or the sendkeypress command on nircmd, this is because 1. The names differ in all 3 applications, 2.- The keys are translated according to the keyboard layout (which is such a great feature by the way) which makes it practically impossible to use substitute to get around it. So, the only thing that would actually work is to get key combinations in other numerical formats (like hex). So maybe Key combination could be an option on its own. And ShowCode could be left as a formatting option.

On my testing, the plugin behaves perfectly fine while using more than a single measure, looks like they all start and stop at the same time even if you only start\stop one, which actually helps to get multiple formats at the same time, which is great :).

The other thing is, could it be possible to add a "OnReleaseAction"? This would help to set actions, such as setting the entered keys to a variable automatically after the keys have been released without having to click on Stop plugin while holding the keys.

To more or less show what I mean, here's a couple gifs. For example, this works perfectly fine for a single key:
1as.gif
However the same would not work with key combinations, as there's no way to return those as hex, so, only the last pressed key will be recorded as hex:
2as.gif
In this case I would like to be able to release the key and save it, instead of clearing it unless I keep pressing it until I click stop. Here is where I would use the OnReleaseAction, so I would stop the measure and save the hotkey as soon as the user releases the key.

By the way, this might be a little bug on the Key Combination mode, as it doesn't happen on other modes. If I enter a key combination, then click stop, then start the plugin again and try to enter another combination, the last combination entered is not cleared automatically (as it happens on modes 0 1 and 3), so the new combination gets added to the previous one:
3as.gif
Here's the code I'm using:

This code is the one I used on the first gift, the only difference between this and the other is ShowCode=4 on [MeasureKeyFriendly].

Code:

[Rainmeter]Update=1000AccurateText=1[Metadata]Name=KeyCodeInfo - Key Combination SkinAuthor=Your NameInformation=This skin demonstrates the KeyCodeInfo plugin in combination mode with a background.Version=1.0[Variables]Key=0x87;-------------------------------------------------; Background;-------------------------------------------------[MeterBackground]Meter=ShapeShape=Rectangle 0,0,400,250,10 | Fill Color 50,50,50,220 | StrokeWidth 0;-------------------------------------------------; Key Combination Measure;-------------------------------------------------[MeasureKeyCode]Measure=PluginPlugin=KeyCodeInfoShowCode=3HideForce=0[MeasureKeyFriendly]Measure=PluginPlugin=KeyCodeInfoShowCode=0HideForce=0[Hotkey]Measure=PluginPlugin=HotKeyHotKey=[#Key]KeyDownAction=[!SetOption HotkeyTxt Text "[#*Key*] Pressed"][!UpdateMeter HotKeyTxt][!Redraw]KeyUpAction=[!SetOption HotkeyTxt Text ""][!UpdateMeter HotKeyTxt][!Redraw]DynamicVariables=1;-------------------------------------------------; Display the key combination;-------------------------------------------------[MeterKeyCombination]Meter=StringMeasureName=MeasureKeyFriendlyX=20Y=20FontSize=28FontColor=255,255,255AntiAlias=1Text="Keys: %1"DynamicVariables=1;-------------------------------------------------; Start Plugin Button;-------------------------------------------------[MeterStart]Meter=StringX=20Y=80FontSize=16FontColor=0,255,0AntiAlias=1Text="Start Plugin"LeftMouseUpAction=!CommandMeasure MeasureKeyCode "Start"DynamicVariables=1;-------------------------------------------------; Stop Plugin Button;-------------------------------------------------[MeterStop]Meter=StringX=200Y=80FontSize=16FontColor=255,0,0AntiAlias=1Text="Stop Plugin"LeftMouseUpAction=[!CommandMeasure MeasureKeyCode "Stop"][!SetVariable Key [MeasureKeyCode]][!UpdateMeasure HotKey][!UpdateMeter MeterHK][!Redraw]DynamicVariables=1[MeterHK]Meter=StringX=20Y=140FontSize=16FontColor=255,255,0AntiAlias=1Text="Hotkey: [#Key]"DynamicVariables=1[HotKeyTxt]Meter=StringX=20Y=200FontSize=16FontColor=0,255,255AntiAlias=1Text=DynamicVariables=1
Thank you very much for this. Have a nice day.

Statistics: Posted by RicardoTM — March 7th, 2025, 10:44 am



Viewing all articles
Browse latest Browse all 27

Trending Articles