It is currently March 29th, 2024, 1:24 pm

Skin to input a keyboard key or shortcut

Get help with installing and using Rainmeter.
rebsxxi
Posts: 2
Joined: June 14th, 2012, 12:06 am

Skin to input a keyboard key or shortcut

Post by rebsxxi »

Hi guys! I'm pretty new to Rainmeter.

I'm just wondering if there is a way for a certain image skin to input a keyboard key (F10, F12, etc.) or a keyboard shortcut (Alt+F4, Windows+J, etc.) instead of actually pressing the keys on the keyboard?

To be specific, I'd like to use The Corner Ribbon skin http://browse.deviantart.com/?qh=&section=&q=the+corner+ribbon#/d3b3l0q, with an app called Jedi Concentrate. So when I click the ribbon, it will input a certain keyboard key (F12) or shortcut (Win+J) to do a task offered by the app.

Any help will be appreciated. :D
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin to input a keyboard key or shortcut

Post by jsmorley »

Not in Rainmeter proper. You would need to call some external program that can simulate keys (AutoIt, NirCmd, etc) and pass the program the values.
rebsxxi
Posts: 2
Joined: June 14th, 2012, 12:06 am

Re: Skin to input a keyboard key or shortcut

Post by rebsxxi »

Thank you sir. I'll try that. :D
Kryptonite
Posts: 6
Joined: June 13th, 2012, 7:42 am

Re: Skin to input a keyboard key or shortcut

Post by Kryptonite »

Thanks JSMorley for the tip on using NirCmd for executing keyboard shortcut keys. I was trying to have a clock skin speak the time when it was clicked. I used a free speaking clock program (http://www.lux-aeterna.com/) that starts with Rainmeter. This program will speak the time when you press ctrl+alt+s. This is why I was looking for something in Rainmeter to execute this key combination.

I downloaded the NirCmd.exe program (http://www.nirsoft.net/utils/nircmd.html) and placed it directly into my windows directory (this is done by the program if you want). The benefit of doing this is that you don't have to add the program location using @include#skinspath# variable to any of your skins.

Issue: To hear the time being spoken by the free speaking clock program I need to press the following keys ctrl+alt+s, however, I want this to be done by clicking the left mouse button on a Rainmeter Clock Skin instead.

Solution: After adding the nircmd.exe program to my windows directory (normally c:\windows\) I added the following line to the Rainmeter clock skin;
LeftMouseUpAction=!execute nircmd.exe sendkeypress ctrl+alt+s

Now when I left click on the clock skin the time is spoken - just what I needed.

Many thanks JSMorley for the tip on using an easy way to send key stroke combinations to execute any given action you may need.
User avatar
DioVikingoMetal
Posts: 29
Joined: January 26th, 2012, 10:40 am
Location: Italy

Re: Skin to input a keyboard key or shortcut

Post by DioVikingoMetal »

How to use nircmd alt + f4 key for display the restart, shutdown window?

Image

I tried this, but doesn't work!

LeftMouseUpAction=!Execute c:\windows\nircmd.exe sendkeypress alt+f4
Image
Alex Becherer

Re: Skin to input a keyboard key or shortcut

Post by Alex Becherer »

DioVikingoMetal wrote:How to use nircmd alt + f4 key for display the restart, shutdown window?



I tried this, but doesn't work!

LeftMouseUpAction=!Execute c:\windows\nircmd.exe sendkeypress alt+f4
no need for NirCmd. try:
LeftMouseUpAction=[taskkill /im explorer.exe]
User avatar
DioVikingoMetal
Posts: 29
Joined: January 26th, 2012, 10:40 am
Location: Italy

Re: Skin to input a keyboard key or shortcut

Post by DioVikingoMetal »

Alex Becherer wrote: no need for NirCmd. try:
LeftMouseUpAction=[taskkill /im explorer.exe]
Great! Thank you! :welcome:
Image
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Skin to input a keyboard key or shortcut

Post by StArL0rd84 »

jsmorley wrote:Not in Rainmeter proper. You would need to call some external program that can simulate keys (AutoIt, NirCmd, etc) and pass the program the values.
Hello :welcome:
I have created this Rainmeter skin which uses the Hotkey plugin together with Nircmd to make a macro string for games. It works like a charm in the windows environment (Like in a text editor). But as soon as i maximize the game, nothing happens when i hit the hotkey.

Image

I suspect that Rainmeter / windows / the plugin is not "listening" for input, when a full screen application is maximized.
My code is as follows:

Code: Select all

[Variables]
nircmd=#@#\Addons\nircmd-x64\nircmd.exe
M1D1=1000
Macro1pt1=m

[Key1]
Measure=Plugin
Plugin=HotKey
HotKey=#Key1#
KeyDownAction=[#nircmd# cmdwait #M1D1# sendkeypress #Macro1Pt1#]


Returns the letter m in text editor but not in the game. (M should open a menu in-game)

I tried this line of code also, to play a sound for testing.
And it also only works when game is minimized :-(
KeyDownAction=[#nircmd# mediaplay 10000 "C:\Users\Michael\Documents\Rockstar Games\GTA V\User Music\Bad Habits _ Tory Lanez Type Beat.mp3"]

I have also made an Autohotkey macro script that works, but i want something with a graphical interface that is makes it easy for the user to change the values like the hotkey and macros, hence Rainmeter.

I made the skin stay topmost as a overlay on the game, but still nothing happened.
Any suggestions is greatly appreciated.
Michael.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Skin to input a keyboard key or shortcut

Post by StArL0rd84 »

Getting the skin to stay on top of the game either in windowed or windowed borderless is no longer the issue.
The fact that the hotkey plugin does not listen for input when the game is maximized, is.

Please help.
Michael.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin to input a keyboard key or shortcut

Post by jsmorley »