def main(): sdk = CueSdk() connected = sdk.connect() if not connected: err = sdk.get_last_error() print("Handshake failed: %s" % err) return subscribed = sdk.subscribe_for_events(SdkEventHandler) if not subscribed: err = sdk.get_last_error() print("Subscribe for events error: %s" % err) return print("Working... Press any G/M key or connect/disconnect Corsair device" + " to see events in action\n") print("Press \"q\" to close program...") while (True): input_str = input() if input_str == "q" or input_str == "Q": print("Exiting.") break sdk.unsubscribe_from_events()
def main(): sdk = CueSdk() connected = sdk.connect() if not connected: err = sdk.get_last_error() print("Handshake failed: " + err) return subscribed = sdk.subscribe_for_events(sdk_event_handler) if not subscribed: err = sdk.get_last_error() print("Subscribe for events error: " + err) return print("Working... Press any G/M key or connect/disconnect Corsair device" " to see events in action\n") print('Press "q" to close program...') while True: input_str = input() if input_str.lower() == "q": print("Exiting.") break sdk.unsubscribe_from_events()