@ -234,7 +234,7 @@ virtual_keyboard_commit_preedit(struct virtual_keyboard *keyboard)
}
}
static void
static void
keyboard_handle_key ( struct keyboard * keyboard , const struct key * key )
keyboard_handle_key ( struct keyboard * keyboard , uint32_t time , const struct key * key )
{
{
const char * label = keyboard - > state = = keyboardstate_default ? key - > label : key - > alt ;
const char * label = keyboard - > state = = keyboardstate_default ? key - > label : key - > alt ;
@ -259,8 +259,10 @@ keyboard_handle_key(struct keyboard *keyboard, const struct key *key)
break ;
break ;
case keytype_enter :
case keytype_enter :
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
input_method_context_key ( keyboard - > keyboard - > context ,
input_method_context_keysym ( keyboard - > keyboard - > context ,
XKB_KEY_KP_Enter , WL_KEYBOARD_KEY_STATE_PRESSED ) ;
display_get_serial ( keyboard - > keyboard - > display ) ,
time ,
XKB_KEY_KP_Enter , WL_KEYBOARD_KEY_STATE_PRESSED , 0 ) ;
break ;
break ;
case keytype_space :
case keytype_space :
keyboard - > keyboard - > preedit_string = strcat ( keyboard - > keyboard - > preedit_string ,
keyboard - > keyboard - > preedit_string = strcat ( keyboard - > keyboard - > preedit_string ,
@ -277,28 +279,38 @@ keyboard_handle_key(struct keyboard *keyboard, const struct key *key)
break ;
break ;
case keytype_tab :
case keytype_tab :
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
input_method_context_key ( keyboard - > keyboard - > context ,
input_method_context_keysym ( keyboard - > keyboard - > context ,
XKB_KEY_Tab , WL_KEYBOARD_KEY_STATE_PRESSED ) ;
display_get_serial ( keyboard - > keyboard - > display ) ,
time ,
XKB_KEY_Tab , WL_KEYBOARD_KEY_STATE_PRESSED , 0 ) ;
break ;
break ;
case keytype_arrow_up :
case keytype_arrow_up :
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
input_method_context_key ( keyboard - > keyboard - > context ,
input_method_context_keysym ( keyboard - > keyboard - > context ,
XKB_KEY_Up , WL_KEYBOARD_KEY_STATE_PRESSED ) ;
display_get_serial ( keyboard - > keyboard - > display ) ,
time ,
XKB_KEY_Up , WL_KEYBOARD_KEY_STATE_PRESSED , 0 ) ;
break ;
break ;
case keytype_arrow_left :
case keytype_arrow_left :
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
input_method_context_key ( keyboard - > keyboard - > context ,
input_method_context_keysym ( keyboard - > keyboard - > context ,
XKB_KEY_Left , WL_KEYBOARD_KEY_STATE_PRESSED ) ;
display_get_serial ( keyboard - > keyboard - > display ) ,
time ,
XKB_KEY_Left , WL_KEYBOARD_KEY_STATE_PRESSED , 0 ) ;
break ;
break ;
case keytype_arrow_right :
case keytype_arrow_right :
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
input_method_context_key ( keyboard - > keyboard - > context ,
input_method_context_keysym ( keyboard - > keyboard - > context ,
XKB_KEY_Right , WL_KEYBOARD_KEY_STATE_PRESSED ) ;
display_get_serial ( keyboard - > keyboard - > display ) ,
time ,
XKB_KEY_Right , WL_KEYBOARD_KEY_STATE_PRESSED , 0 ) ;
break ;
break ;
case keytype_arrow_down :
case keytype_arrow_down :
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
virtual_keyboard_commit_preedit ( keyboard - > keyboard ) ;
input_method_context_key ( keyboard - > keyboard - > context ,
input_method_context_keysym ( keyboard - > keyboard - > context ,
XKB_KEY_Down , WL_KEYBOARD_KEY_STATE_PRESSED ) ;
display_get_serial ( keyboard - > keyboard - > display ) ,
time ,
XKB_KEY_Down , WL_KEYBOARD_KEY_STATE_PRESSED , 0 ) ;
break ;
break ;
}
}
}
}
@ -330,7 +342,7 @@ button_handler(struct widget *widget,
for ( i = 0 ; i < sizeof ( keys ) / sizeof ( * keys ) ; + + i ) {
for ( i = 0 ; i < sizeof ( keys ) / sizeof ( * keys ) ; + + i ) {
col - = keys [ i ] . width ;
col - = keys [ i ] . width ;
if ( col < 0 ) {
if ( col < 0 ) {
keyboard_handle_key ( keyboard , & keys [ i ] ) ;
keyboard_handle_key ( keyboard , time , & keys [ i ] ) ;
break ;
break ;
}
}
}
}