def handle_event(self, event): '''Handle BPS events for our domain''' code = bps.bps_event_get_code(event) # print('NAV: {}, 0x{:x}'.format(code, code)) if code == bps.NAVIGATOR_INVOKE_TARGET: print('NAVIGATOR_INVOKE_TARGET') invoke = navigator_invoke_event_get_invocation(event) print('invoke is', invoke) invoke_id = navigator_invoke_invocation_get_id(invoke) print('invoke id', invoke_id) target = navigator_invoke_invocation_get_target(invoke) print('target', target) action = navigator_invoke_invocation_get_action(invoke) print('action', action) elif code == bps.NAVIGATOR_INVOKE_TARGET_RESULT: print('NAVIGATOR_INVOKE_TARGET_RESULT') # this retrieves the id set with navigator_invoke_invocation_set_id() print('nav id', bps.navigator_event_get_id(event)) print('nav err', bps.navigator_event_get_err(event))
def make_event(self, bps_event): code = bps.bps_event_get_code(bps_event) rc = paymentservice_event_get_response_code(bps_event) if rc == bps.BPS_FAILURE: raise PaymentError('unable to get event type') type = rc payment_event = bps_event return PaymentEvent(code, type, payment_event)
def handle_event(self, event): '''Handle BPS events for our domain''' code = bps.bps_event_get_code(event) # new event is issued when locale values change print('locale: event {}'.format(code)) if code == bps.LOCALE_INFO: print('locale', bps.locale_event_get_locale(event)) print('country', bps.locale_event_get_country(event)) print('language', bps.locale_event_get_language(event)) print('script', bps.locale_event_get_script(event))
def handle_event(self, event): """Handle BPS events for our domain""" code = bps.bps_event_get_code(event) # new event is issued when locale values change print("locale: event {}".format(code)) if code == bps.LOCALE_INFO: print("locale", bps.locale_event_get_locale(event)) print("country", bps.locale_event_get_country(event)) print("language", bps.locale_event_get_language(event)) print("script", bps.locale_event_get_script(event))
def make_event(self, bps_event): code = bps.bps_event_get_code(bps_event) intval = c_int() rc = bbmsp_event_get_category(bps_event, byref(intval)) if rc == BBMSP_FAILURE: raise BbmError('unable to get event category') category = intval.value rc = bbmsp_event_get_type(bps_event, byref(intval)) if rc == BBMSP_FAILURE: raise BbmError('unable to get event type') type = intval.value bbm_event = POINTER(bbmsp_event_t)() rc = bbmsp_event_get(bps_event, byref(bbm_event)) if rc == BBMSP_FAILURE: raise BbmError('unable to get bbmsp_event') return BbmEvent(code, category, type, bbm_event)
def handle_event(self, event): '''Handle BPS events for our domain''' code = bps.bps_event_get_code(event) if code in self.KB_STATE_CODES: tart.send('keyboardState', visible=(code == bps.VIRTUALKEYBOARD_EVENT_VISIBLE))