It is currently May 25th, 2020, 2:52 pm

App Launcher for access with remote control

General topics related to Rainmeter.
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

Yincognito wrote:
April 20th, 2020, 12:13 am
Quick question: are you sure you aren't able to use your remote to move the mouse, instead of simulating key press? Of course, I'm not aware of your setup, but for me, my Avermedia TV Tuner remote is able to move the mouse and simulate the ENTER key, when the TV Tuner application is not started. As you could see, there are plenty of ways to zoom in or enlarge parts of your desktop, or even make your mouse cursor bigger so that you can see it from distance, so if you can simulate mouse movement and click / ENTER using your remote, everything would be much easier, and no additional work to modify the skin would be required...
with the remote control I have, it's not possible. I could by another one that would do the job. However, I doubt that this is a solution in this case since I'm sure it is much more easy for the old man to navigate by moving just between 2-3 icons instead of moving a mouse cursor around a complete monitor ;)
User avatar
balala
Rainmeter Sage
Posts: 10577
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: App Launcher for access with remote control

Post by balala »

Wolfson wrote:
April 19th, 2020, 8:56 pm
I could get a short example to work to start an application with a keyboard press. Now I'm wondering how I could get a navigation between a number of shown skins, e.g. 4 skins showing icons that represent an application respectively. Then when the desired skin is highlighted (after navigating to it with the arrow keys), the Enter key press should open it.
Unfortunately if you're talking about moving the cursor with the arrows of the keyboard (supposing with the remote control) I don't know a way to achieve this.
Probably if there is a keyboard as well, the simplest solution would be to associate a key to each program you (he) want to start, then use those keys. Isn't this a solution?
User avatar
Yincognito
Posts: 1611
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: App Launcher for access with remote control

Post by Yincognito »

balala wrote:
April 20th, 2020, 8:43 am
Unfortunately if you're talking about moving the cursor with the arrows of the keyboard (supposing with the remote control) I don't know a way to achieve this.
Probably if there is a keyboard as well, the simplest solution would be to associate a key to each program you (he) want to start, then use those keys. Isn't this a solution?
I think he just wants to "jump" between the "buttons" / skins by simulating the arrow keys' press (using his remote). I don't think the "cursor" is involved, as far as I could understand - my cursor question was just me trying to explore an easier alternative than to modify an entire skin in order to achieve what the OP wants. Sorry for intervening in this, I never meant to be a cause of confusion - keep going. ;-)
User avatar
balala
Rainmeter Sage
Posts: 10577
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: App Launcher for access with remote control

Post by balala »

Yincognito wrote:
April 20th, 2020, 9:24 am
I think he just wants to "jump" between the "buttons" / skins by simulating the arrow keys' press (using his remote). I don't think the "cursor" is involved, as far as I could understand - my cursor question was just me trying to explore an easier alternative than to modify an entire skin in order to achieve what the OP wants. Sorry for intervening in this, I never meant to be a cause of confusion - keep going. ;-)
No, no, the more ideas, the better, probably. For now I don't see very well how that remote control works, so just gave my opinion.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3930
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: App Launcher for access with remote control

Post by eclectic-tech »

Late to the party as usual... :D

Not sure if the OP is still actively following this thread, but here is an example using the HotKey plugin...
It uses 4 images that are almost full screen; sides are not covered so the skin does not interfere with Windows OS actions.

The plugin does not need focus for key presses to register. If it is the only activity, then this is not a problem, but using other apps while this skin is active, may launch one of the processes. I chose "ESCAPE" as the activatekey variable, but any other key will work.

It's position could be set to "TopMost" or "Staytomost'" if desired by adding [!ZPos 1] or [!ZPos 2] to the OnRefreshAction in the [Rainmeter] section. UP/DOWN keys will change the selection, the ESCAPE key activates the highlighted process.

Code: Select all

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=
; BY=attribution / SA=share-alike / ND=no-derivatives / NC=non-commercial
License=CC BY-SA-NC 3.0
Version=

; ========= Variables ==========
[Variables]
process1name=skype
process1=skype.exe

process2name=internet
process2=chrome.exe

process3name=notes
process3=notepad.exe

process4name=calculator
process4=calc.exe

activatekey=ESCAPE
; Set by skin actions
selected=1
alpha1=255
alpha2=55
alpha3=55
alpha4=55

; ========= Skin Settings ==========
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

OnRefreshAction=[!Move "0" "0"][!ZPos 0]

; ========= Measures ==========
[MeasureHotKeyUp]
Measure=Plugin
Plugin=HotKey
HotKey=UP
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyDown]
Measure=Plugin
Plugin=HotKey
HotKey=DOWN
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyActivateProcess]
Measure=Plugin
Plugin=HotKey
HotKey=#activatekey#
;ShowAllKeys=1
KeyUpAction=["[#process[#selected]]"]
DynamicVariables=1

[MeasureAlpha]
Measure=Calc
Formula=#selected#
IfCondition=(#selected#=1)
IfTrueAction=[!SetVariable Alpha1 255][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition2=(#selected#=2)
IfTrueAction2=[!SetVariable Alpha1 55][!SetVariable Alpha2 255][!SetVariable Alpha3 55][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition3=(#selected#=3)
IfTrueAction3=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 255][!SetVariable Alpha4 55][!UpdateMeter *][!Redraw]
IfCondition4=(#selected#=4)
IfTrueAction4=[!SetVariable Alpha1 55][!SetVariable Alpha2 55][!SetVariable Alpha3 55][!SetVariable Alpha4 255][!UpdateMeter *][!Redraw]
IfConditionMode=1
DynamicVariables=1

; ========= Meter Styles ==========
[TextStyle]
StringCase=Upper
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontSize=36
DynamicVariables=1


; ========= Meters ==========
[Background]
Meter=Image
X=1
Y=1
W=(#WorkAreaWidth#-2)
H=(#WorkAreaHeight#-2)
SolidColor=0,0,0

[MeterImage1]
Meter=Image
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=222,22,22,#alpha1#
AntiAlias=1

[MeterImage2]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=222,222,22,#alpha2#
AntiAlias=1

[MeterImage3]
Meter=Image
DynamicVariables=1
X=1
Y=R
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=222,22,222,#alpha3#
AntiAlias=1

[MeterImage4]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=22,22,222,#alpha4#
AntiAlias=1

[MeterString1]
Meter=String
MeterStyle=TextStyle
X=([MeterImage1:W]*0.5)
Y=([MeterImage1:H]*0.5)
Text=#process1name#
FontColor=255,255,255,[#Alpha1]

[MeterString2]
Meter=String
MeterStyle=TextStyle
X=([MeterImage1:XW]+[MeterImage2:W]*0.5)
Y=([MeterImage2:YH]*0.5)
Text=#process2name#
FontColor=255,255,255,[#Alpha2]

[MeterString3]
Meter=String
MeterStyle=TextStyle
X=([MeterImage3:W]*0.5)
Y=([MeterImage1:YH]+[MeterImage3:H]*0.5)
Text=#process3name#
FontColor=255,255,255,[#Alpha3]

[MeterString4]
Meter=String
MeterStyle=TextStyle
X=([MeterImage1:XW]+[MeterImage4:W]*0.5)
Y=([MeterImage1:YH]+[MeterImage4:H]*0.5)
Text=#process4name#
FontColor=255,255,255,[#Alpha4]

panel4.gif
Click image to show animation...
You do not have the required permissions to view the files attached to this post.
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

Yincognito wrote:
April 20th, 2020, 9:24 am
I think he just wants to "jump" between the "buttons" / skins by simulating the arrow keys' press (using his remote). I don't think the "cursor" is involved, as far as I could understand
Exactly. Maybe I should instead just switch to another remote control that provides more buttons and use the method @balala suggests with opening programs just with a button...
I have to think about it ;)
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

eclectic-tech wrote:
April 20th, 2020, 4:13 pm
Late to the party as usual... :D

Not sure if the OP is still actively following this thread, but here is an example using the HotKey plugin...
It uses 4 images that are almost full screen; sides are not covered so the skin does not interfere with Windows OS actions.

...
Wow, that looks interesting, will check this in the evening...
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

Wolfson wrote:
April 20th, 2020, 4:18 pm
Wow, that looks interesting, will check this in the evening...

...

So this is definetely the way to go for me, really great!
I've changed the navigation to

Code: Select all

; ========= Measures ==========
[MeasureHotKeyUp]
Measure=Plugin
Plugin=HotKey
HotKey=UP
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyDown]
Measure=Plugin
Plugin=HotKey
HotKey=DOWN
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+2,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyRight]
Measure=Plugin
Plugin=HotKey
HotKey=RIGHT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#+1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeasureHotKeyLeft]
Measure=Plugin
Plugin=HotKey
HotKey=LEFT
;ShowAllKeys=1
KeyUpAction=[!SetVariable selected (Clamp(#selected#-1,1,4))][!UpdateMeasure MeasureAlpha][!UpdateMeter *][!Redraw]
DynamicVariables=1
and figured out I can add an image with

Code: Select all

[MeterImage1]
Meter=Image
ImageName=#@#Images\Phone.jpg
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=222,22,22,#alpha1#
AntiAlias=1
I have to experiment a bit more in order to figure out how to set transparent colors on the images to be able to still see the highlighting. Furthermore the image will be scaled as well, which is not good since it deforms the icon...
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

I do have nice adapted pictures now and it looks good. Only two things are not working properly yet:
  • The navigation as well as the action key to start an application always works. This is a problem since when an application is open, the same keys are used to navigate/start services within the application, e.g. in Skype, the contact list is browsed and by clicking the same button, a call is initiated. The issue is then that rainmeter (still being active underneath) starts another application. How can I have the skin only accepting key input when no other application is active on top of it?
  • The navigation sometimes works as expected, but sometimes just does not do what it is supposed to do, So it e.g. moves from the top left field to the one below when pressing the right arrow. Why could this happen with the code I've slightly adapted to also accept up/down arrows?
Thanks in advance for every hint!!!
User avatar
balala
Rainmeter Sage
Posts: 10577
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: App Launcher for access with remote control

Post by balala »

Wolfson wrote:
April 22nd, 2020, 7:23 am
  • The navigation as well as the action key to start an application always works. This is a problem since when an application is open, the same keys are used to navigate/start services within the application, e.g. in Skype, the contact list is browsed and by clicking the same button, a call is initiated. The issue is then that rainmeter (still being active underneath) starts another application. How can I have the skin only accepting key input when no other application is active on top of it?
Probably you should disable the HotKey plugin measures when another application is started and re-enable it when the application is closed. However take care that you can't do this through !DisableMeasure / !EnableMeasure bangs, these bangs don't disable / enable a HotKey plugin measure. Disabling / enabling them can be done through the following bangs:
  • Disabling: [!CommandMeasure "MeasureHotKeyUp" "Stop"]
  • Enabling: [!CommandMeasure "MeasureHotKeyUp" "Start"]
Note that you have to add four such !CommandMeasure bangs, one for each plugin measure ([MeasureHotKeyUp], [MeasureHotKeyDown], [MeasureHotKeyRight] and [MeasureHotKeyLeft])
Do you know how to check if the application is running? If you don't know, let us know, to help you.
Wolfson wrote:
April 22nd, 2020, 7:23 am
  • The navigation sometimes works as expected, but sometimes just does not do what it is supposed to do, So it e.g. moves from the top left field to the one below when pressing the right arrow. Why could this happen with the code I've slightly adapted to also accept up/down arrows?
Not knowing the whole code, it is practically impossible to tell why. So please for first post the whole code of the skin.