static BOOL ssd_container_on_key_pressed( SsdWidget widget, const char* utf8char, uint32_t flags) { if( KEY_IS_ENTER && widget->callback) { widget->callback( widget, SSD_BUTTON_SHORT_CLICK); return TRUE; } return FALSE; }
static BOOL OnKeyPressed (SsdWidget widget, const char* utf8char, uint32_t flags){ BOOL key_handled = TRUE; if( KEY_IS_ENTER) { widget->callback(widget, SSD_BUTTON_SHORT_CLICK); return TRUE; } if( KEYBOARD_VIRTUAL_KEY & flags) { switch( *utf8char) { case VK_Arrow_up: move_up(); break; case VK_Arrow_down: move_down(); break; default: key_handled = FALSE; } } else { assert(utf8char); assert(*utf8char); // Other special keys: if( KEYBOARD_ASCII & flags) { switch(*utf8char) { case TAB_KEY: move_down(); break; default: key_handled = FALSE; } } } if( key_handled) roadmap_screen_redraw (); return key_handled; }
static BOOL ssd_button_on_key_pressed (SsdWidget button, const char* utf8char, uint32_t flags) { struct ssd_button_data *data = (struct ssd_button_data *) button->data; if (data->state == BUTTON_STATE_DISABLED) return FALSE; if( KEY_IS_ENTER ) { button->callback(button, SSD_BUTTON_SHORT_CLICK); return TRUE; } return FALSE; }