Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Close OS Menu after a delay
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Close OS Menu after a delay
I'm trying to have the OS Menu closed after some time, i have tried with Wait(10sec) + Jump but it don't work, any hint ?
Re: Close OS Menu after a delay
You can use System.Idle timer. Set it up, say, on 10 seconds.
You can trigger "OS Menu: CANCEL" on System.Idle event.
I done it right that way.
To stop closing OSMenu after unpredictable period of time, while i'm calling OSMenu, i'm also resetting System.Idle timer to zero.
Also, i'm resetting System.Idle timer with every press OSMenu keys.
Example:
To reset System.Idle timer i'm using "Emulate keystrokes <right shift>.
May be there is a better way, but it working OK for me.
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
<Action>
System.SetIdleTime(10.0)
</Action>
</EventGhost>
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
<Macro Name="Cancel" Expanded="True">
<Event Name="System.Idle" />
<Action>
OSM.Cancel_Btn()
</Action>
</Macro>
</EventGhost>
To stop closing OSMenu after unpredictable period of time, while i'm calling OSMenu, i'm also resetting System.Idle timer to zero.
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
<Folder Name="IdleReseter" Expanded="True">
<Macro Name="IdleReseter" Expanded="True">
<Event Name="Lirc.Menu" />
<Action>
Window.SendKeys(u'{RShift}', False)
</Action>
</Macro>
</Folder>
</EventGhost>
Example:
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1534">
<Macro Name="OS Menu: Page Down" Expanded="True">
<Event Name="Lirc.Left" />
<Action>
OSM.PageDown()
</Action>
<Action>
Window.SendKeys(u'{RShift}', False)
</Action>
</Macro>
</EventGhost>
May be there is a better way, but it working OK for me.
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Close OS Menu after a delay
Python script huh ? Why not , problem is there are errors returned
1st script:
Error compiling script.
Traceback (most recent call last):
SyntaxError: invalid syntax (5, line 1)
2nd script:
Error compiling script.
Traceback (most recent call last):
SyntaxError: invalid syntax (6, line 1)
1st script:
Error compiling script.
Traceback (most recent call last):
SyntaxError: invalid syntax (5, line 1)
2nd script:
Error compiling script.
Traceback (most recent call last):
SyntaxError: invalid syntax (6, line 1)
Re: Close OS Menu after a delay
This is not a python scripts.
This is just a parts of my EG config.
First code is from an autostart section (setting up idle timer).
Second you can copy and paste in any section of your config.
Of course, you already should have OSmenu plagin enabled.
Those codes are given is just as examples for you. You should adapt them to your needs.
This is just a parts of my EG config.
First code is from an autostart section (setting up idle timer).
Second you can copy and paste in any section of your config.
Of course, you already should have OSmenu plagin enabled.
Those codes are given is just as examples for you. You should adapt them to your needs.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Close OS Menu after a delay
I do not understand why you're doing such a complicated manner.wakko wrote:You can use System.Idle timer. Set it up, say, on 10 seconds.
You can trigger "OS Menu: CANCEL" on System.Idle event.
I done it right that way.
To stop closing OSMenu after unpredictable period of time, while i'm calling OSMenu, i'm also resetting System.Idle timer to zero.
Also, i'm resetting System.Idle timer with every press OSMenu keys.
To reset System.Idle timer i'm using "Emulate keystrokes <right shift>.
May be there is a better way, but it working OK for me.
After all you can do it as follows:However it has one drawback.
If you normally choose some action in OSM and then you open another menu (before the preset time expires),
then it prematurely closes the new menu.
Pako
Re: Close OS Menu after a delay
Thank you Pako for your critics.
However, my main goal was to trigger "OS Menu: Cancel" action only, if there is no any activity for a 10 seconds.
I'm using OS Menu for building TV channels streaming list, with many positions in it. It is huge. The way i'm using "OS Menu: Cancel" gives me as many time as i need to choose TV channel, without OS Menu suddenly closes by time out (triggered by triggerevent action).
However, my main goal was to trigger "OS Menu: Cancel" action only, if there is no any activity for a 10 seconds.
I'm using OS Menu for building TV channels streaming list, with many positions in it. It is huge. The way i'm using "OS Menu: Cancel" gives me as many time as i need to choose TV channel, without OS Menu suddenly closes by time out (triggered by triggerevent action).
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Close OS Menu after a delay
If you are uncomfortable mentioned disadvantage, you can do the following:Python Script:Pako
Code: Select all
eg.scheduler.CancelTask(eg.globals.osmDelay)
eg.globals.osmDelay = eg.scheduler.AddTask(10, eg.plugins.OSM.Cancel_Btn)Re: Close OS Menu after a delay
Pako's second solution looks great and would work perfectly, i think.
I suggest to topic starter use it.
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Close OS Menu after a delay
I tried your python commands Pako without luck. Do i need a plugin or something ?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Close OS Menu after a delay
No, do not need anything else.
I do not see why it would not work.
However it is clear that it can work when you're going to control the menu using the keyboard.
It is necessary to control it using the prepared actions.
In the example shown, however, are no events.
You must complete the required events (of course it depends on what you have remote control).
Pako
I do not see why it would not work.
However it is clear that it can work when you're going to control the menu using the keyboard.
It is necessary to control it using the prepared actions.
In the example shown, however, are no events.
You must complete the required events (of course it depends on what you have remote control).
Pako
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Close OS Menu after a delay
After further testing it is working. It seems you have to put each command right after OS Menu show menu / Cancel. The problem was that i have things after such as Find window OS Menu; bring to front or enable Context folder.
Picture of the working configuration:
http://imageupload.org/en/file/187177/o ... y.jpg.html
Many thanks to you Pako
Picture of the working configuration:
http://imageupload.org/en/file/187177/o ... y.jpg.html
Many thanks to you Pako
Last edited by themaster1 on Fri Feb 24, 2012 8:56 am, edited 1 time in total.
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Close OS Menu after a delay
I have a request: Can the scrollbar of the Os Menu be cosmetically arranged ? (it look old school)
I have many items on the menu and now the scroll bar appear at the right side
picture:
http://imageupload.org/en/file/187189/s ... r.jpg.html
I have many items on the menu and now the scroll bar appear at the right side
picture:
http://imageupload.org/en/file/187189/s ... r.jpg.html
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Close OS Menu after a delay
Actually something's wrong with Os Menu Cancel, it don't enable the context menu if i don't pick an item from the list
see this picture again: http://imageupload.org/en/file/187177/o ... y.jpg.html
I guess that's because it is triggered by the python command rather than the event remote. Sounds like i'll need more python commands
see this picture again: http://imageupload.org/en/file/187177/o ... y.jpg.html
I guess that's because it is triggered by the python command rather than the event remote. Sounds like i'll need more python commands
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Close OS Menu after a delay
I think the solution is very easy. Just read the description of the OSM plugin and act accordingly.Pako
-
themaster1
- Experienced User
- Posts: 133
- Joined: Wed Feb 03, 2010 9:02 pm
Re: Close OS Menu after a delay
Well if i put the OsMenu folder above the Context folder it don't change anything