Question about 'actions' performed by keybindings vs. onclick/onfocus
#1
Hi, sorry if i miss something in aknowledgement but i have some trouble understand it, because it working differently.


1:  Homescreen

I have an Vertical Home Menu, where i like to use the shutdown menu when click <onback>
(since on left is open submenu, on right focuses widgets in my case)
<onback condition="!Skin.HasSetting(DisablePowerMenu)">ActivateWindow(ShutdownMenu)</onback> <!-- forces autoclose settings.xml after choose -->

This works well, to open it and choose between the buttons i set , but if i want to open Window(settings) / settings.xml , just that window auto closes itself
(all others hortcuts inside the group working without issues).

xml:

shortcut actions
<onclick condition="Window.IsActive(DialogButtonMenu.xml)">Close</onclick>
<onclick>ActivateWindow(Settings)</onclick>

If i use the keybord key "s",  or <onleft>, or <onright> tags,  all is working without issues. (no autoclose)

Does <onback> perform some hidden things ?

2. Stop Playback

In my VideoInfo ihave the option in the skin to perform automatic trailer playback on load.
xml:

 <control type="button" id="9005">
<onfocus condition="!Skin.HasSetting(UseExtendedInfoDialog) + Skin.HasSetting(videoinfo_traileraction,auto) + [[String.IsEqual(Window(Home).Property(contenttype),movies) | String.IsEqual(ListItem.DBTYPE,movie)] | ![String.IsEqual(Window(Home).Property(contenttype),tvshows) | String.IsEqual(ListItem.DBTYPE,tvshow)]]">PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
            <onfocus condition="!Skin.HasSetting(UseExtendedInfoDialog) + Skin.HasSetting(videoinfo_traileraction,auto) + [![String.IsEqual(Window(Home).Property(contenttype),movies) | String.IsEqual(ListItem.DBTYPE,movie)] | [String.IsEqual(Window(Home).Property(contenttype),tvshows) | String.IsEqual(ListItem.DBTYPE,tvshow)]]">RunScript(script.skin.helper.service,action=playtraileryoutube,title=$INFO[ListItem.Title],local=true)</onfocus>
</control>

I have set a button inside a grouplist , to use perform a stop .
xml:

<control type="button" id="204">
                            <!-- stop trailer -->
                            <label>Stop</label>
                            <width>285</width>
                            <height>40</height>
                            <align>center</align>
                            <textoffsetx>0</textoffsetx>
                            <onclick>Stop</onclick> <!-- also tried <onclick>PlayerControl(Stop)</onclick> -->
                            <visible>Player.HasVideo</visible>
                        </control>

The Issue - If i use the button 204, the trailer will play in loop.
If i perform Stop via the "x" on keyboard i didt get the unwished loop effect.

(PS: button "9005" is just for use on first load up, i'll not gain focus again, till re-open the movieinformation window)


Is there something i miss on that behaviours (key cmds versus <on**> tags) ?


Is there a possible workararound to perform "press key" actions inside the <on***> tags ?
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#2
Does the shutdown dialog not close anyway when opening settings?

If not try -

xml:
<onclick condition="Window.IsActive(DialogButtonMenu.xml)">Dialog.Close(shutdownmenu)</onclick>

Maybe the play trailer button is getting focus again somehow; instead try using the onload function -

xml:
<onload condition="!Skin.HasSetting(UseExtendedInfoDialog) + Skin.HasSetting(videoinfo_traileraction,auto) + [[String.IsEqual(Window(Home).Property(contenttype),movies) | String.IsEqual(ListItem.DBTYPE,movie)] | ![String.IsEqual(Window(Home).Property(contenttype),tvshows) | String.IsEqual(ListItem.DBTYPE,tvshow)]]">PlayMedia($INFO[ListItem.Trailer],1)</onload>
<onload condition="!Skin.HasSetting(UseExtendedInfoDialog) + Skin.HasSetting(videoinfo_traileraction,auto) + [![String.IsEqual(Window(Home).Property(contenttype),movies) | String.IsEqual(ListItem.DBTYPE,movie)] | [String.IsEqual(Window(Home).Property(contenttype),tvshows) | String.IsEqual(ListItem.DBTYPE,tvshow)]]">RunScript(script.skin.helper.service,action=playtraileryoutube,title=$INFO[ListItem.Title],local=true)</onload>
Reply
#3
Did you try <onload> instead of <onfocus> in button 9005?
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#4
Thanks, for fast response.

@Hitcher ,

a) shutdown : the dialog (DialogButtonMenu.xml) itself, closes correct.
The issue is more that, if use <onback> to open shutdown, i'm not able to "stay" in settings after select it.

(i have found an workaround for that now, by using custom list inside the home layout, instead of the <ActivateWindow(ShutdownMenu)> tag ,  i call/focus just the list with  <content> tags,
but still wonder why JUST the setting, auto close itself, on the default behaviour...)

As it is not posiible to see in Video (first is a home layout with a custom shutdown menu , which gain focus through <onback> and uses content tag (working flawless) ,
2nd Home : i use 2 times  "backspace/return" key (after select settings -> Setting Window autoclose itslef) , the last and 3rd time i use "s" instead of "backspace" to activate(ShutDownMenu) -> settings window stay open)

b) trailer : i will trie to move that control, from button, to the onload action. Will report back. How its working.
(But still wondered about why "x" key,wich have same action, as the button "204" is working perfect, when the click on a button does not ;-) )

So, @manfeed , i have an <onload> set to the hidden button "9005", so on first load of movieinformation,  "9005" will set the actions needed depending to the skinsettings with <onfocus>

xml:
<?xml version="1.0" encoding="utf-8"?>
<!--Titan Mod-->
<window>
    <defaultcontrol always="true">9005</defaultcontrol>
    <onload condition="System.HasAlarm(trailer_delay)">CancelAlarm(trailer_delay,true)</onload>
    <onload condition="Player.HasVideo + ![VideoPlayer.Content(movies) | VideoPlayer.Content(episodes) | VideoPlayer.Content(musicvideos) | VideoPlayer.Content(livetv)]">SetProperty(TrailerPlaying,windowed,Home)</onload>
    <onload condition="String.IsEqual(Window(Home).Property(BaseWindow),InfoDialog)">ClearProperty(BaseWindow,Home)</onload>
    <onunload condition="!String.IsEmpty(Window(Home).Property(ShowSpotlightInfo))">SetFocus(505)</onunload>
    <onunload>ClearProperty(AdditionalInfo)</onunload>
    <onunload>ClearProperty(filename_formatted,Home)</onunload>  
    <onunload condition="!String.IsEmpty(Window(Home).Property(ShowSpotlightInfo))">ClearProperty(ShowSpotlightInfo,Home)</onunload>
    
    <controls>
        <!-- fake button with actions -->
        <control type="button" id="9005">
            <visible allowhiddenfocus="true">false</visible>
            <onfocus>RunScript(script.skin.helper.service,action=GETFILENAME,output=filename_formatted)</onfocus>
            <onfocus condition="System.HasAddon(script.videoextras)">XBMC.RunScript(script.videoextras,check,"$INFO[ListItem.FilenameAndPath]")</onfocus>
            <onfocus condition="System.HasAddon(script.extendedinfo) + Skin.HasSetting(UseExtendedInfoDialog) + String.IsEqual(Window(Home).Property(contenttype),movies)">RunScript(script.extendedinfo,info=extendedinfo,dbid=$INFO[ListItem.DBID],name=$INFO[ListItem.Title])</onfocus>
            <onfocus condition="System.HasAddon(script.extendedinfo) + Skin.HasSetting(UseExtendedInfoDialog) + String.IsEqual(Window(Home).Property(contenttype),tvshows)">RunScript(script.extendedinfo,info=extendedtvinfo,dbid=$INFO[ListItem.DBID],name=$INFO[ListItem.TvShowTitle])</onfocus>
            <onfocus condition="System.HasAddon(script.extendedinfo) + Skin.HasSetting(UseExtendedInfoDialog) + String.IsEqual(Window(Home).Property(contenttype),seasons)">RunScript(script.extendedinfo,info=seasoninfo,tvshow=$INFO[ListItem.TvShowTitle],season=$INFO[ListItem.Season],silent=True)</onfocus>
            <onfocus condition="System.HasAddon(script.extendedinfo) + Skin.HasSetting(UseExtendedInfoDialog) + String.IsEqual(Window(Home).Property(contenttype),episodes)">RunScript(script.extendedinfo,info=extendedepisodeinfo,tvshow=$INFO[ListItem.TvShowTitle],season=$INFO[ListItem.Season],episode=$INFO[ListItem.Episode],silent=True)</onfocus>
            <onfocus condition="!Skin.HasSetting(UseExtendedInfoDialog) + Skin.HasSetting(videoinfo_traileraction,auto) + [[String.IsEqual(Window(Home).Property(contenttype),movies) | String.IsEqual(ListItem.DBTYPE,movie)] | ![String.IsEqual(Window(Home).Property(contenttype),tvshows) | String.IsEqual(ListItem.DBTYPE,tvshow)]]">PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
            <onfocus condition="!Skin.HasSetting(UseExtendedInfoDialog) + Skin.HasSetting(videoinfo_traileraction,auto) + [![String.IsEqual(Window(Home).Property(contenttype),movies) | String.IsEqual(ListItem.DBTYPE,movie)] | [String.IsEqual(Window(Home).Property(contenttype),tvshows) | String.IsEqual(ListItem.DBTYPE,tvshow)]]">RunScript(script.skin.helper.service,action=playtraileryoutube,title=$INFO[ListItem.Title],local=true)</onfocus>
            <onfocus condition="System.HasAddon(script.extendedinfo) + Skin.HasSetting(UseExtendedInfoDialog)">close</onfocus>            
            <onfocus condition="!Skin.HasSetting(UseExtendedInfoDialog)">SetFocus(8000)</onfocus>
        </control>        
        <!-- include conditon -->
        <include condition="Skin.HasSetting(UseNetflixInfoDialog) + !Skin.HasSetting(UseExtendedInfoDialog)">NetflixInfo</include>        
        <include condition="!Skin.HasSetting(UseNetflixInfoDialog) + !Skin.HasSetting(UseExtendedInfoDialog)">DefaultInfo</include>
        <include condition="Skin.HasSetting(DebugGrid) | Skin.HasSetting(DebugInfo)">DebugInfo</include>
    </controls>
</window>



Since i like to have 2 diff, movieinfo screens. Heres the include. (i think not realy needed, but...)

IncludesDialogVideoInfo.xml
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#5
Yeah using onback on the home screen can cause problems as it's hardcoded to do certain things. eg If playing music/video it will override what you want it to do and go to the visualiser/fullscreen video.
Reply
#6
(2018-10-30, 12:48)Hitcher Wrote: Yeah using onback on the home screen can cause problems as it's hardcoded to do certain things. eg If playing music/video it will override what you want it to do and go to the visualiser/fullscreen video.
 ok, thanks, i can live with it. ;-)
Skins |  Titan M O D   •   S W A N (WIP)
Reply

Logout Mark Read Team Forum Stats Members Help
Question about 'actions' performed by keybindings vs. onclick/onfocus0