SendClick() in AddonBrowser
#1
Anyone know if it's possible to point a SendClick() to the "Search" entry in AddonBrowser.xml (from other windows)?
Can anyone give me a clue about how/where to find the ID for that control? I've been looking through the source, but for me that's still a needle in a haystack sort of thing unfortunately.
Reply
#2
it's a listitem so i don't think it's possible.

for future reference, when you need to find the id of a built-in control,
the easiest way would be to enable debugging in your addon.xml file.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
I see, that's too bad. Cheers for the debugging tip, totally forgot about that.
Reply
#4
No that's not possible. It's just a listitem so you can't do a SendClick(). However you can simply run ActivateWindow(addonbrowser,addons://search/your_search_term). Only drawback seems to be that if you hit backspace in the addonbrowser, the keyboard pops up again for a new search (I guess this could probably be eliminated by closing the keyboard immediately if someone made a search from outside the addonbrowser).

PHP Code:
<control type="button">
  [...]
  <
onclick>SetProperty(OpenAddonBrowser,1,virtualkeyboard)</onclick>
  <
onclick>Skin.SetString(AddonSearchTerm)</onclick
</
control>

#In DialogKeyboard.xml you need to do this:
<onunload condition="!IsEmpty(Window(virtualkeyboard).Property(OpenAddonBrowser)) + 
!IsEmpty(Window(virtualkeyboard).Property(Confirmed))"
>ActivateWindow(addonbrowser,$INFO[Skin.String(AddonSearchTerm),addons://search/,])</onunload>
<onunload condition="!IsEmpty(Window(virtualkeyboard).Property(OpenAddonBrowser))">ClearProperty(OpenAddonBrowser,virtualkeyboard)</onunload>
<
onunload condition="!IsEmpty(Window(virtualkeyboard).Property(Confirmed))">ClearProperty(Confirmed,virtualkeyboard)</onunload>

#This is the done key
<control type="button" id="300">
  [...]
  <
onclick condition="!IsEmpty(Window(virtualkeyboard).Property(OpenAddonBrowser))">SetProperty(Confirmed,1)</onclick>
</
control

I have not tested the code but that's how it could work.
Image
Reply
#5
Thanks 'Black, that makes sense. I haven't been able to get it working yet though. After entering the search term the keyboard closes but the addonbrowser won't open.
I'll do some more experimenting with it though, definitely a clever approach
Reply

Logout Mark Read Team Forum Stats Members Help
SendClick() in AddonBrowser0