Kodi Community Forum

Full Version: SendClick for buttons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Trying to use SendClick assigned to a keyboard, but can't get it working.

To test, I created a generic button button -
xml:
<control type="button" id="500">
  <description>button to toggle settings - for debug only</description>
  <visible>true</visible>
  <left>15</left>
  <top>15</top>
  <height>55</height>
  <width>55</width>
  <texturenofocus>defaulticonwarning.png</texturenofocus>
  <texturefocus>defaulticonwarning.png</texturefocus>
  <onclick>Skin.ToggleSetting(HideList)</onclick>
</control>

And then assigned a key -
xml:
<home>
   <keyboard>
        <F5>SendClick(500)</F5>
   </keyboard>
</home>

Pressing F5 generates this in the Debug log, so it seems to be working -
DEBUG: CInputManager::HandleKey: f5 (0xf094) pressed, action is SendClick(500)

But no action takes place.

From a search of the forum, all the prior questions seem to to be focused on using this to send a click to the control IDs that are part of the in the builtin windows, and not for a general application.   Is that the problem here?
Why not just use this instead?

xml:
<home>
   <keyboard>
        <F5>Skin.ToggleSetting(HideList)</F5>
   </keyboard>
</home>
(2019-11-07, 21:45)Hitcher Wrote: [ -> ]Why not just use this instead?

xml:
<home>
   <keyboard>
        <F5>Skin.ToggleSetting(HideList)</F5>
   </keyboard>
</home>
I had that at first, but as I kept working the click of the button now contains several <onclick> actions in addition to the toggle setting.  Hard to map to a single key, so I was looking for a way to get there.   Ultimately, I was trying to avoid a short script.
The "Commands" add-on lets you map multiple actions to a single key/button:
https://kodi.wiki/view/Add-on:Commands