Page 2 of 17

Re: HotKey plugin (in beta)

Posted: July 23rd, 2014, 9:29 pm
by rm_lion
Hi rm_lion, I just have a few questions for you.

1. What is the HotKey you are using?
2. Did you exit Rainmeter normally?
3. Are you using a non-US keyboard?

It is important to remember that all the keys in the hotkey should be released nearly at the same time.

-Brian
1.
For example I use CTRL+SHIFT+M to Toggle my SpotifySkin

Code: Select all

[MeasureToggleSpotifySkin]
Measure=Plugin
Plugin=HotKey
HotKey="CTRL SHIFT M"
Action=!ToggleConfig "Spotify" "SoitaSpotify.ini"
I can keep CTRL+SHIFT pressed and just release the M Button and then the Skin immediately opens. Whit CTRL+SHIFT still pressed I can press and release the M Button again and the Skin gets closed again.

2. I right-klicked on the Rainmeter-Symbol in the System Tray and did choose Exit. And then I did start Rainmeter again.

3. I have a Swiss-Keyboard. But I don't think that it has something to do with that. Because normally everything works perfect.

Re: HotKey plugin (in beta)

Posted: July 24th, 2014, 3:38 am
by Brian
@rm_lion: I sent you a PM with a version of HotKey that should log what is happening. Just follow the instructions and let me know.
rm_lion wrote:I can keep CTRL+SHIFT pressed and just release the M Button and then the Skin immediately opens. Whit CTRL+SHIFT still pressed I can press and release the M Button again and the Skin gets closed again.
This is actually correct behavior even though I said all keys need to be released. The reason is because CTRL, SHIFT, and ALT can sometimes (but not always) modify which key is really being pressed. For example, on some keyboards if you press SHIFT and "6" on the numeric keypad, neither the SHIFT or "6" is sent to the OS, instead a "right arrow" key is sent to the OS. This of course differs from keyboard to keyboard.

-Brian

Re: HotKey plugin (in beta)

Posted: July 24th, 2014, 7:28 am
by rm_lion
@Brian

Here is the logfile.

Have a nice day
lion

Re: HotKey plugin (in beta)

Posted: July 24th, 2014, 1:17 pm
by Brian
@lion: Thanks again for testing that plugin. If you start to have problems again, email me your log file and hopefully we can work through any problems that come up.

-Brian

Re: HotKey plugin (in beta)

Posted: July 27th, 2014, 8:45 am
by rm_lion
Useful (Works for Win8.1 and Win7. For other Systems you have to try):

NextWallpaper

Code: Select all

[MeasureNextWallpaper]
Measure=Plugin
Plugin=HotKey
HotKey="CTRL SHIFT W"
Action=[#@#\NextWallpaper.vbs]
Vbs-Script (Copy the following code and Place it in your @Resources-Folder as "NextWallpaper.vbs"

Code: Select all

set WshShell = WScript.CreateObject("WScript.Shell")
         WshShell.SendKeys("^ ")
         WshShell.SendKeys("+{F10}")
         WshShell.SendKeys("n+{Enter}")
According to your Windows Language you may have to Change the Letter "n" in "WshShell.SendKeys("n+{Enter}")"
Go to your Desktop and press Shift+F10 and check which Letter is underlined for Next Wallpaper

Start Screensaver

Code: Select all

[MeasureStartScreensaver]
Measure=Plugin
Plugin=HotKey
HotKey="CTRL SHIFT S"
Action=[C:\Windows\System32\PhotoScreensaver.scr]

Re: HotKey plugin (in beta)

Posted: August 1st, 2014, 7:14 pm
by killall-q
Image

Snake

I hope for key up/down states and responsiveness improvements in the future so I can do Pong.

Re: HotKey plugin (in beta)

Posted: August 1st, 2014, 8:06 pm
by Brian
killall-q wrote:I hope for key up/down states ...
I played around with that idea of up/down states when I first started, but I was finding it difficult to react to when there are repeating keystrokes. For instance, when doing a HotKey like "SHIFT A", I found the keyboard sending the "SHIFT" down key like 5 times before I actually pressed the "A" key. Now, that wouldn't be a huge problem, but since I analyzing the entire keyboard on each key press, it makes the plugin work harder to process the repeated key presses.

Anyway, if I can find a way around the repeat processing, I might introduce up/down states.

killall-q wrote:... and responsiveness improvements ...
Could you elaborate on this? The actions I have set up seem to work nearly instantly as I release the keys, so I don't see any responsiveness issues. I guess if you have a lot of HotKey measures, and type really fast, it may not see it, but I doubt it. There is a small chance that Windows is stopping the plugin from finishing under certain conditions, but we can over that a later time after I have made some changes.

-Brian

Re: HotKey plugin (in beta)

Posted: August 1st, 2014, 8:33 pm
by killall-q
Brian wrote:Could you elaborate on this? The actions I have set up seem to work nearly instantly as I release the keys, so I don't see any responsiveness issues.
Sorry for the gross oversimplification. Instant response is top notch (otherwise I would not have added a "very hard" difficulty) but there is possibly an issue of keystrokes simply being ignored if they follow too closely to previous keystrokes.

U-turns are possible but tricky, and tight zig-zagging unfeasible. But the cause could partly be the way I handle input on an update by update basis. I'll try to implement an input queue system and see if zig-zagging becomes possible.

Edit: OK, input buffer has been implemented. It's much better and the keystrokes that are being ignored by the plugin can be isolated.

Re: HotKey plugin 0.0.1.5 (in beta)

Posted: August 6th, 2014, 8:21 pm
by Brian
Posted a new version here: http://rainmeter.net/forum/viewtopic.php?p=102030#p102030

It is important to note that I have radically changed the plugin to help make it faster and more responsive.

There is now KeyUpAction and KeyDownAction instead of just Action. There is also some new commands to stop, start, and toggle the plugins state.

Known Issues:
1. If using multiple keys, you may need to release the keys in reverse order from how they are pressed to get the KeyUpAction to work correctly. I am unsure if there is a solution as Windows sometimes removes the "key up" messages off the queue before my plugin can read them. For example: In my test skin, hold down "Shift" and then push and hold "B", then release "Shift" before you release "B". This seems to happen to the modifier keys (Shift, CTRL, ALT) more then anything, so be careful.
2. When using "ShowAllKeys" sometimes the log will show the wrong key name. For example, the "Page Up" will come up as "Num 9". However, the hex code will be correct, so make sure to use that.

Enjoy!

-Brian

Re: HotKey plugin 0.0.1.6 (in beta)

Posted: August 6th, 2014, 9:28 pm
by Brian
New version here: http://rainmeter.net/forum/viewtopic.php?p=102030#p102030

Sorry, quick bug fix that I missed in the previous version.

-Brian