Kodi Community Forum
How-To bind a key to a socket command? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152)
+---- Thread: How-To bind a key to a socket command? (/showthread.php?tid=143915)



How-To bind a key to a socket command? - kersal - 2012-10-29

Hi,
i need to bind this simple command to a key on XBMC but i don't know how:

"
def send(cmdopen):
client = socket(AF_INET, SOCK_STREAM)
client.connect((my_ip, int(my_port)))
client.send(cmdopen)
client.close
"

So I need that when i click a key (e.g. "s") it run "send (cmdopen)
How can I do?

p.s. all that variables can be fixed (i know all of them and never change)