forked from Miroirs/x49gp
split emulator key pressing out of gui functions
This commit is contained in:
parent
5df16bb28f
commit
01da733778
1 changed files with 18 additions and 8 deletions
|
@ -709,6 +709,22 @@ char* css_global = "window {"
|
||||||
/* functions */
|
/* functions */
|
||||||
/*************/
|
/*************/
|
||||||
|
|
||||||
|
static void x49gpng_press_key( x49gp_t* x49gp, const x49gp_ui_key_t* key )
|
||||||
|
{
|
||||||
|
if ( key->rowbit )
|
||||||
|
s3c2410_io_port_g_update( x49gp, key->column, key->row, key->columnbit, key->rowbit, 1 );
|
||||||
|
else
|
||||||
|
s3c2410_io_port_f_set_bit( x49gp, key->eint, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void x49gpng_release_key( x49gp_t* x49gp, const x49gp_ui_key_t* key )
|
||||||
|
{
|
||||||
|
if ( key->rowbit )
|
||||||
|
s3c2410_io_port_g_update( x49gp, key->column, key->row, key->columnbit, key->rowbit, 0 );
|
||||||
|
else
|
||||||
|
s3c2410_io_port_f_set_bit( x49gp, key->eint, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
static inline int _tiny_text_width( const char* text )
|
static inline int _tiny_text_width( const char* text )
|
||||||
{
|
{
|
||||||
char* stripped_text;
|
char* stripped_text;
|
||||||
|
@ -743,10 +759,7 @@ static void ui_release_button( x49gp_ui_button_t* button, x49gp_ui_button_t* cau
|
||||||
/* gtkbutton->in_button = false; */
|
/* gtkbutton->in_button = false; */
|
||||||
key_to_button( button->button, false );
|
key_to_button( button->button, false );
|
||||||
|
|
||||||
if ( key->rowbit )
|
x49gpng_release_key( x49gp, key );
|
||||||
s3c2410_io_port_g_update( x49gp, key->column, key->row, key->columnbit, key->rowbit, 0 );
|
|
||||||
else
|
|
||||||
s3c2410_io_port_f_set_bit( x49gp, key->eint, 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ui_release_all_buttons( x49gp_t* x49gp, x49gp_ui_button_t* cause )
|
static void ui_release_all_buttons( x49gp_t* x49gp, x49gp_ui_button_t* cause )
|
||||||
|
@ -801,10 +814,7 @@ static gboolean react_to_button_press( GtkWidget* widget, GdkEventButton* event,
|
||||||
button->key->eint );
|
button->key->eint );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( key->rowbit )
|
x49gpng_press_key( x49gp, key );
|
||||||
s3c2410_io_port_g_update( x49gp, key->column, key->row, key->columnbit, key->rowbit, 1 );
|
|
||||||
else
|
|
||||||
s3c2410_io_port_f_set_bit( x49gp, key->eint, 1 );
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue