mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 20:18:22 +08:00
improve keyboard
This commit is contained in:
parent
f39839dea7
commit
c60eab92e7
@ -1240,8 +1240,7 @@ ret_t widget_on_pointer_down(widget_t* widget, pointer_event_t* e) {
|
|||||||
|
|
||||||
target = widget_find_target(widget, e->x, e->y);
|
target = widget_find_target(widget, e->x, e->y);
|
||||||
if (target != NULL && target->enable) {
|
if (target != NULL && target->enable) {
|
||||||
const char* type = widget_get_type(target);
|
if (!(target->vt->is_keyboard)) {
|
||||||
if (!tk_str_eq(type, WIDGET_TYPE_KEYBOARD)) {
|
|
||||||
if (!target->focused) {
|
if (!target->focused) {
|
||||||
event_t focus = event_init(EVT_FOCUS, target);
|
event_t focus = event_init(EVT_FOCUS, target);
|
||||||
if (widget->key_target) {
|
if (widget->key_target) {
|
||||||
|
@ -86,6 +86,10 @@ typedef struct _widget_vtable_t {
|
|||||||
* 是否是设计窗口。
|
* 是否是设计窗口。
|
||||||
*/
|
*/
|
||||||
uint32_t is_designing_window : 1;
|
uint32_t is_designing_window : 1;
|
||||||
|
/**
|
||||||
|
* 是否是软键盘(点击软键盘不改变编辑器的焦点)。
|
||||||
|
*/
|
||||||
|
uint32_t is_keyboard: 1;
|
||||||
|
|
||||||
widget_create_t create;
|
widget_create_t create;
|
||||||
widget_get_prop_t get_prop;
|
widget_get_prop_t get_prop;
|
||||||
|
@ -47,6 +47,7 @@ static ret_t keyboard_on_destroy(widget_t* widget) {
|
|||||||
static const widget_vtable_t s_keyboard_vtable = {.size = sizeof(keyboard_t),
|
static const widget_vtable_t s_keyboard_vtable = {.size = sizeof(keyboard_t),
|
||||||
.type = WIDGET_TYPE_KEYBOARD,
|
.type = WIDGET_TYPE_KEYBOARD,
|
||||||
.is_window = TRUE,
|
.is_window = TRUE,
|
||||||
|
.is_keyboard = TRUE,
|
||||||
.clone_properties = s_keyboard_properties,
|
.clone_properties = s_keyboard_properties,
|
||||||
.persistent_properties = s_keyboard_properties,
|
.persistent_properties = s_keyboard_properties,
|
||||||
.create = keyboard_create,
|
.create = keyboard_create,
|
||||||
|
Loading…
Reference in New Issue
Block a user