def main(): host = "localhost" port = 9777 # Create an XBMCClient object and connect xbmc = XBMCClient("Example Remote", "../../icons/bluetooth.png") xbmc.connect() # send a up key press using the xbox gamepad map "XG" and button # name "dpadup" ( see PacketBUTTON doc for more details) try: xbmc.send_action(sys.argv[2], ACTION_BUTTON) except: try: xbmc.send_action(sys.argv[1], ACTION_EXECBUILTIN) except Exception as e: print(str(e)) xbmc.send_action("ActivateWindow(ShutdownMenu)") # ok we're done, close the connection # Note that closing the connection clears any repeat key that is # active. So in this example, the actual release button event above # need not have been sent. xbmc.close()
def main(): host = "localhost" port = 9777 # Create an XBMCClient object and connect xbmc = XBMCClient("Example Remote", "../../icons/bluetooth.png") xbmc.connect() # wait for notification window to close (in XBMC) (optional) time.sleep(5) # send a up key press using the xbox gamepad map "XG" and button # name "dpadup" ( see PacketBUTTON doc for more details) xbmc.send_button(map="XG", button="dpadup") # wait for a few seconds to see its effect time.sleep(5) # send a right key press using the keyboard map "KB" and button # name "right" xbmc.send_keyboard_button("right") # wait for a few seconds to see its effect time.sleep(5) # that's enough, release the button. xbmc.release_button() # ok we're done, close the connection # Note that closing the connection clears any repeat key that is # active. So in this example, the actual release button event above # need not have been sent. xbmc.close()
def main(): host = "localhost" port = 9777 # Create an XBMCClient object and connect xbmc = XBMCClient("Example Remote", "../../icons/bluetooth.png") xbmc.connect() # wait for notification window to close (in XBMC) (optional) time.sleep(5) # send a up key press using the xbox gamepad map "XG" and button # name "dpadup" ( see PacketBUTTON doc for more details) xbmc.send_button(map="XG", button="dpadup") # wait for a few seconds to see its effect time.sleep(5) # send a right key press using the keyboard map "KB" and button # name "right" xbmc.send_keyboard_button("right") # wait for a few seconds to see its effect time.sleep(5) # that's enough, release the button. xbmc.release_button() # ok we're done, close the connection # Note that closing the connection clears any repeat key that is # active. So in this example, the actual release button event above # need not have been sent. xbmc.close()
def main(): host = "localhost" port = 9777 # Create an XBMCClient object and connect xbmc = XBMCClient("Example Remote", "../../icons/bluetooth.png") xbmc.connect() # send a up key press using the xbox gamepad map "XG" and button # name "dpadup" ( see PacketBUTTON doc for more details) try: xbmc.send_action(sys.argv[2], ACTION_BUTTON) except: try: xbmc.send_action(sys.argv[1], ACTION_EXECBUILTIN) except Exception as e: print(str(e)) xbmc.send_action("ActivateWindow(ShutdownMenu)") # ok we're done, close the connection # Note that closing the connection clears any repeat key that is # active. So in this example, the actual release button event above # need not have been sent. xbmc.close()
if recordtimeloop == "0": recordtime = 300 if recordtimeloop == "1": recordtime = 600 if recordtimeloop == "2": recordtime = 900 if recordtimeloop == "3": recordtime = 1800 if recordtimeloop == "4": recordtime = 3600 if recordmode == "true": loop_recording = 1 else: loop_recording = 0 if "HFlip" in data: splitflip = data.split(',') hflip = str(splitflip[1]) if hflip == "true": camera.hflip = True else: camera.hflip = False if "Exit" in data: exit = 1 break sock.close() xbmc.close() camera.close()