It is currently March 28th, 2024, 12:49 pm

App Launcher for access with remote control

General topics related to Rainmeter.
User avatar
balala
Rainmeter Sage
Posts: 16109
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
Rainmeter Sage
Posts: 7018
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: 16109
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: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

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...
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: 16109
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.
Wolfson
Posts: 16
Joined: April 18th, 2020, 2:00 pm

Re: App Launcher for access with remote control

Post by Wolfson »

balala wrote: April 22nd, 2020, 8:58 am 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.

Not knowing the whole code, it is practically impossible to tell why. So please for first post the whole code of the skin.
Thanks a lot balala for the help! That looks good. I will try to find the right spot to add the commands you provided. Regarding the process-check, I don't know yet how to do it, but will try to find out. Help is of course always welcome :)

The code currently looks like this:

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]
process1=C:\Program Files\TrueConf\Client\TrueConf.exe
process2=C:\Users\bla\Desktop\some.url
process3=C:\Users\bla\Desktop\Diashow.exe
process4=

activatekey=ENTER
; Set by skin actions
selected=1
alpha1=255
alpha2=75
alpha3=75
alpha4=75

; ========= Skin Settings ==========
[Rainmeter]
Update=10000
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#-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

[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
ImageName=#@#Images\Phone.png
DynamicVariables=1
X=1
Y=1
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,50,#alpha1#
AntiAlias=1

[MeterImage2]
Meter=Image
DynamicVariables=1
X=R
Y=r
W=([Background:W]*0.5)
H=([Background:H]*0.5)
ImageName=#@#Images\Lahoe.png
SolidColor=50,50,200,#alpha2#
AntiAlias=1

[MeterImage3]
Meter=Image
ImageName=#@#Images\Diashow.png
DynamicVariables=1
X=1
Y=R
W=([Background:W]*0.5)
H=([Background:H]*0.5)
SolidColor=200,50,200,#alpha3#
AntiAlias=1

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

Post Reply