• Vítejte na XBMC-Kodi.cz
  • Česko-slovenská komunita fanoušků XBMC/Kodi
Vítejte návštevníku! Přihlášení Registrace


Hodnocení tématu:
  • 1 Hlas(ů) - 5 Průměr
  • 1
  • 2
  • 3
  • 4
  • 5
Mapování tlačítek DO - tipy a triky
Pomůcka k testování DO

Množství DO, které mi prošly rukama a Kodi, pro které jsme je zprovozňoval, už je nemalé. Už před časem jsme si vytvořil jednoduchou pomůcku a když jsem se v posledních dnech tématu kolem DO a Kodi věnoval zvlášť intenzivně, trochu jsem onu pomůcku doladil. Co je jejím principem a obsahem?

Princip je jendoduchý. Je jím vytvořený mapovací soubo 99_keymap.xml, pak uživatelsky definované okno v modifikovaném skinu Estuary Custom_1199_Keymap.xml a nakonec doplnění možnosti spuštění testování z menu Kodi. Uživatelsky definované okno a doplnění možnosti spuštění testování, to jsou už jen takové třešničky na dortu. Zásadní je mapovací soubor. Mám ho vytvořený pro většinu známých tlačítek, pro které pro keyboard i remote existují v Kodi příslušné metakódy. Vynechal jsme ta zřejmá (písmena, i jjeich modifikace ctrl, alt, shift). V souboru se ale nemapují žádé funkce, pouze se zobrazí notitikace Kodi s příslušnou identifikací. V notifikaci se zobrazí nejen označení typu (keyboard nebo remote), ale i případný příznak longpress a pak metakód stiknutého tlačítka.

Vypadá to asi tako:
           

To, co je na tomto řešení nejdůležitější, to je vlastní mapovací soubor. Ostatní věci jsou už hodně závislé na vaší instalaci a jejich použití vyžadují hlubší znalosti. Proto je neuvádím. Ale mapovací soubor přikládám jak v textové formě tak i jako skutečný soubor, protože se dá (při rozumném použití) použít i bez toho zbytku.
 
Kód:
<?xml version="1.0" encoding="UTF-8"?>
            <!-- <xxx>Notification(Test/keyboard,xxx,500)</xxx> -->
            <!-- <xxx mod="longpress">Notification(Test/eyboard,[COLOR red]longpress[/COLOR] xxx,500)</xxx> -->

            <!-- <xxx>Notification(Test/remote,xxx,500)</xxx> -->
            <!-- <xxx mod="longpress">Notification(Test/remote,[COLOR red]longpress[/COLOR] xxx,500)</xxx> -->
<keymap> <!-- 99_keymap.xml Test mapping file - 2022-04-22 by JiRo -->
    <!-- <global> -->
        <!-- <keyboard> -->
            <!-- <key id="251">Notification(Global/keyboard,Id=251 red,500)</key> -->
        <!-- </keyboard> -->
    <!-- </global> -->
    <!-- <fullscreenlivetv> -->
        <!-- <keyboard> -->
            <!-- <key id="251">Notification(fullscreenlivetv/keyboard,Id=251 red,500)</key> -->
        <!-- </keyboard> -->
    <!-- </fullscreenlivetv> -->
    <window1199>
        <keyboard>
            <voicecommand>Notification(Test/keyboard,voicecommand,500)</voicecommand>

            <power>Notification(Test/keyboard,power,500)</power>
            <power mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] power,500)</power>
            <sleep>Notification(Test/keyboard,sleep,500)</sleep>
            <sleep mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] sleep,500)</sleep>

            <browser_back>Notification(Test/keyboard,browser_back,500)</browser_back>
            <browser_back mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] browser_back,500)</browser_back>
            <browser_home>Notification(Test/keyboard,browser_home,500)</browser_home>
            <browser_home mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] browser_home,500)</browser_home>
            <browser_forward>Notification(Test/keyboard,browser_forward,500)</browser_forward>>
            <browser_forward mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] browser_forward,500)</browser_forward>>
            <browser_refresh>Notification(Test/keyboard,browser_refresh,500)</browser_refresh>
            <browser_refresh mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] browser_refresh,500)</browser_refresh>
            <browser_stop>Notification(Test/keyboard,browser_stop,500)</browser_stop>
            <browser_stop mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] browser_stop,500)</browser_stop>
            <browser_search>Notification(Test/keyboard,browser_search,500)</browser_search>
            <browser_search mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] browser_search,500)</browser_search>
            <browser_favorites>Notification(Test/keyboard,browser_favorites,500)</browser_favorites>
            <browser_favorites mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] browser_favorites,500)</browser_favorites>

            <red>Notification(Test/keyboard,red,500)</red>
            <red mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] red,500)</red>
            <green>Notification(Test/keyboard,green,500)</green>
            <green mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] green,500)</green>
            <yellow>Notification(Test/keyboard,yellow,500)</yellow>
            <yellow mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] yellow,500)</yellow>
            <blue>Notification(Test/keyboard,blue,500)</blue>
            <blue mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] blue,500)</blue>

            <menu>Notification(Test/keyboard,menu,500)</menu>
            <menu mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] menu,500)</menu>
            <homepage>Notification(Test/keyboard,homepage,500)</homepage>
            <homepage mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] homepage,500)</homepage>
            <epg>Notification(Test/keyboard,epg,500)</epg>
            <epg mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] epg,500)</epg>

            <left>Notification(Test/keyboard,left,500)</left>
            <left mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] left,500)</left>
            <right>Notification(Test/keyboard,right,500)</right>
            <right mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] right,500)</right>
            <up>Notification(Test/keyboard,up,500)</up>
            <up mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] up,500)</up>
            <down>Notification(Test/keyboard,down,500)</down>
            <down mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] down,500)</down>

            <insert>Notification(Test/keyboard,insert,500)</insert>
            <insert mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] insert,500)</insert>
            <delete>Notification(Test/keyboard,delete,500)</delete>
            <delete mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] delete,500)</delete>

            <home>Notification(Test/keyboard,home,500)</home>
            <home mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] home,500)</home>
            <end>Notification(Test/keyboard,end,500)</end>
            <end mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] end,500)</end>

            <pageup>Notification(Test/keyboard,pageup,500)</pageup>
            <pageup mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] pageup,500)</pageup>
            <pagedown>Notification(Test/keyboard,pagedown,500)</pagedown>
            <pagedown mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] pagedown,500)</pagedown>

            <return>Notification(Test/keyboard,return,500)</return>
            <return mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] return,500)</return>
            <enter>Notification(Test/keyboard,enter,500)</enter>
            <enter mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] enter,500)</enter>
            <backspace>Notification(Test/keyboard,backspace,500)</backspace>
            <backspace mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] backspace,500)</backspace>
            <escape>Notification(Test/keyboard,escape,500)</escape>
            <escape mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] escape,500)</escape>
            <tab>Notification(Test/keyboard,tab,500)</tab>
            <tab mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] tab,500)</tab>
            
            <period>Notification(Test/keyboard,period,500)</period>
            <period mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] period,500)</period>
            <numpadperiod>Notification(Test/keyboard,numpadperiod,500)</numpadperiod>
            <numpadperiod mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadperiod,500)</numpadperiod>

            <volume_mute>Notification(Test/keyboard,volume_mute,500)</volume_mute>
            <volume_mute mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] volume_mute,500)</volume_mute>
            <volume_down>Notification(Test/keyboard,volume_down,500)</volume_down>
            <volume_down mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] volume_down,500)</volume_down>
            <volume_up>Notification(Test/keyboard,volume_up,500)</volume_up>
            <volume_up mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] volume_up,500)</volume_up>

            <next_track>Notification(Test/keyboard,next_track,500)</next_track>
            <next_track mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] next_track,500)</next_track>
            <prev_track>Notification(Test/keyboard,prev_track,500)</prev_track>
            <prev_track mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] prev_track,500)</prev_track>
            <stop>Notification(Test/keyboard,stop,500)</stop>
            <stop mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] stop,500)</stop>
            <play>Notification(Test/keyboard,play,500)</play>
            <play mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] play,500)</play>
            <pause>Notification(Test/keyboard,pause,500)</pause>
            <pause mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] pause,500)</pause>
            <play_pause>Notification(Test/keyboard,play_pause,500)</play_pause>
            <play_pause mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] play_pause,500)</play_pause>
            <fastforward>Notification(Test/keyboard,fastforward,500)</fastforward>
            <fastforward mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] fastforward,500)</fastforward>
            <rewind>Notification(Test/keyboard,rewind,500)</rewind>
            <rewind mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] rewind,500)</rewind>
            <record>Notification(Test/keyboard,record,500)</record>
            <record mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] record,500)</record>

            <zero>Notification(Test/keyboard,zero,500)</zero>
            <zero mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] zero,500)</zero>
            <one>Notification(Test/keyboard,one,500)</one>
            <one mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] one,500)</one>
            <two>Notification(Test/keyboard,two,500)</two>
            <two mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] two,500)</two>
            <three>Notification(Test/keyboard,three,500)</three>
            <three mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] three,500)</three>
            <four>Notification(Test/keyboard,four,500)</four>
            <four mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] four,500)</four>
            <five>Notification(Test/keyboard,five,500)</five>
            <five mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] five,500)</five>
            <six>Notification(Test/keyboard,six,500)</six>
            <six mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] six,500)</six>
            <seven>Notification(Test/keyboard,seven,500)</seven>
            <seven mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] seven,500)</seven>
            <eight>Notification(Test/keyboard,eight,500)</eight>
            <eight mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] eight,500)</eight>
            <nine>Notification(Test/keyboard,nine,500)</nine>
            <nine mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] nine,500)</nine>

            <numpadzero>Notification(Test/keyboard,numpadzero,500)</numpadzero>
            <numpadzero mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadzero,500)</numpadzero>
            <numpadone>Notification(Test/keyboard,numpadone,500)</numpadone>
            <numpadone mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadone,500)</numpadone>
            <numpadtwo>Notification(Test/keyboard,numpadtwo,500)</numpadtwo>
            <numpadtwo mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadtwo,500)</numpadtwo>
            <numpadthree>Notification(Test/keyboard,numpadthree,500)</numpadthree>
            <numpadthree mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadthree,500)</numpadthree>
            <numpadfour>Notification(Test/keyboard,numpadfour,500)</numpadfour>
            <numpadfour mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadfour,500)</numpadfour>
            <numpadfive>Notification(Test/keyboard,numpadfive,500)</numpadfive>
            <numpadfive mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadfive,500)</numpadfive>
            <numpadsix>Notification(Test/keyboard,numpadsix,500)</numpadsix>
            <numpadsix mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadsix,500)</numpadsix>
            <numpadseven>Notification(Test/keyboard,numpadseven,500)</numpadseven>
            <numpadseven mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadseven,500)</numpadseven>
            <numpadeight>Notification(Test/keyboard,numpadeight,500)</numpadeight>
            <numpadeight mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadeight,500)</numpadeight>
            <numpadnine>Notification(Test/keyboard,numpadnine,500)</numpadnine>
            <numpadnine mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] numpadnine,500)</numpadnine>

            <f1>Notification(Test/keyboard,f1,500)</f1>
            <f1 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f1,500)</f1>
            <f2>Notification(Test/keyboard,f2,500)</f2>
            <f2 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f2,500)</f2>
            <f3>Notification(Test/keyboard,f3,500)</f3>
            <f3 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f3,500)</f3>
            <f4>Notification(Test/keyboard,f4,500)</f4>
            <f4 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f4,500)</f4>
            <f5>Notification(Test/keyboard,f5,500)</f5>
            <f5 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f5,500)</f5>
            <f6>Notification(Test/keyboard,f6,500)</f6>
            <f6 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f6,500)</f6>
            <f7>Notification(Test/keyboard,f7,500)</f7>
            <f7 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f7,500)</f7>
            <f8>Notification(Test/keyboard,f8,500)</f8>
            <f8 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f8,500)</f8>
            <f9>Notification(Test/keyboard,f9,500)</f9>
            <f9 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f9,500)</f9>
            <f10>Notification(Test/keyboard,f10,500)</f10>
            <f10 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f10,500)</f10>
            <f11>Notification(Test/keyboard,f11,500)</f11>
            <f11 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f11,500)</f11>
            <f12>Notification(Test/keyboard,f12,500)</f12>
            <f12 mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] f12,500)</f12>

            <!-- <key id="251">Notification(Test/keyboard,Id=251 red,500)</key> -->
            <!-- <key id="251" mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] Id=251 red,500)</key> -->
            <!-- <key id="252">Notification(Test/keyboard,Id=252 green,500)</key> -->
            <!-- <key id="252" mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] Id=252 green,500)</key> -->
            <!-- <key id="253">Notification(Test/keyboard,Id=253 yellow,500)</key> -->
            <!-- <key id="253" mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] Id=253 yellow,500)</key> -->
            <!-- <key id="254">Notification(Test/keyboard,Id=254 blue,500)</key> -->
            <!-- <key id="254" mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] Id=254 blue,500)</key> -->

            <!-- <key id="249">Notification(Test/keyboard,Id=249 exit,500)</key> -->
            <!-- <key id="249" mod="longpress">Notification(Test/keyboard,[COLOR red]longpress[/COLOR] Id=249 exit,500)</key> -->
        </keyboard>
        <remote>
            <play>Notification(Test/remote,play,500)</play>
            <pause>Notification(Test/remote,pause,500)</pause>
            <stop>Notification(Test/remote,stop,500)</stop>
            <forward>Notification(Test/remote,forward,500)</forward>
            <reverse>Notification(Test/remote,reverse,500)</reverse>

            <left>Notification(Test/remote,left,500)</left>
            <right>Notification(Test/remote,right,500)</right>
            <up>Notification(Test/remote,up,500)</up>
            <down>Notification(Test/remote,down,500)</down>

            <select>Notification(Test/remote,select,500)</select>
            <enter>Notification(Test/remote,enter,500)</enter>
            <pageplus>Notification(Test/remote,pageplus,500)</pageplus>
            <pageminus>Notification(Test/remote,pageminus,500)</pageminus>
            <back>Notification(Test/remote,back,500)</back>
            <menu>Notification(Test/remote,menu,500)</menu>
            <contentsmenu>Notification(Test/remote,contentsmenu,500)</contentsmenu>
            <rootmenu>Notification(Test/remote,rootmenu,500)</rootmenu>
            <title>Notification(Test/remote,title,500)</title>
            <info>Notification(Test/remote,info,500)</info>
            
            <skipplus>Notification(Test/remote,skipplus,500)</skipplus>
            <skipminus>Notification(Test/remote,skipminus,500)</skipminus>

            <display>Notification(Test/remote,display,500)</display>
            <start>Notification(Test/remote,start,500)</start>
            <record>Notification(Test/remote,record,500)</record>
            <eject>Notification(Test/remote,eject,500)</eject>
            <volumeplus>Notification(Test/remote,volumeplus,500)</volumeplus>
            <volumeminus>Notification(Test/remote,volumeminus,500)</volumeminus>
            <mute>Notification(Test/remote,mute,500)</mute>
            <power>Notification(Test/remote,power,500)</power>

            <myvideo>Notification(Test/remote,myvideo,500)</myvideo>
            <mymusic>Notification(Test/remote,mymusic,500)</mymusic>
            <mypictures>Notification(Test/remote,mypictures,500)</mypictures>
            <mytv>Notification(Test/remote,mytv,500)</mytv>

            <guide>Notification(Test/remote,guide,500)</guide>
            <livetv>Notification(Test/remote,livetv,500)</livetv>
            <liveradio>Notification(Test/remote,liveradio,500)</liveradio>
            <recordedtv>Notification(Test/remote,recordedtv,500)</recordedtv>
            <epgsearch>Notification(Test/remote,epgsearch,500)</epgsearch>

            <red>Notification(Test/remote,red,500)</red>
            <green>Notification(Test/remote,green,500)</green>
            <yellow>Notification(Test/remote,yellow,500)</yellow>
            <blue>Notification(Test/remote,blue,500)</blue>

            <zero>Notification(Test/remote,zero,500)</zero>
            <one>Notification(Test/remote,one,500)</one>
            <two>Notification(Test/remote,two,500)</two>
            <three>Notification(Test/remote,three,500)</three>
            <four>Notification(Test/remote,four,500)</four>
            <five>Notification(Test/remote,five,500)</five>
            <six>Notification(Test/remote,six,500)</six>
            <seven>Notification(Test/remote,seven,500)</seven>
            <eight>Notification(Test/remote,eight,500)</eight>
            <nine>Notification(Test/remote,nine,500)</nine>
            
            <print>Notification(Test/remote,print,500)</print>

            <clear>Notification(Test/remote,clear,500)</clear>
            <star>Notification(Test/remote,star,500)</star>
            <hash>Notification(Test/remote,hash,500)</hash>
        </remote>
    </window1199>
</keymap>
V mapování jsou vidět i mé poslední pokusy při řešení jednoho konkrétního porblému, ty jsem zakomentoval.

Ke stažení je soubor zde:

.xml   99_keymap.xml (Velikost: 17,47 KB / Stažení: 12)

Nyní mám ještě v plánu vyrobit jednoduchý addon, který by mi vypisoval action Id a button code stisknutých tlačítek. Bude to celkem triviální funkce, ale umožní mi se obejít bez Keymap Editoru. Funkčně je to celkem jednoduchá úloha, ale já chci vymyslet nějaké smysluplné ovládání a pak i nějaký způsob, jak výstup z addon použít pro další práci s mapováním.
 
Citovat
  


Příspěvků v tématu
RE: Mapování tlačítek DO - tipy a triky - od JiRo - 23.4.2022, 13:21

Přejít na fórum:


Prochází: 1 host(ů)