Use lookup_key() on keyboard events.
This commit is contained in:
parent
29a1eef1de
commit
fd32485983
|
@ -368,35 +368,18 @@ static u16 Cur_Keypad = 0;
|
||||||
|
|
||||||
static gint Key_Press(GtkWidget *w, GdkEventKey *e)
|
static gint Key_Press(GtkWidget *w, GdkEventKey *e)
|
||||||
{
|
{
|
||||||
int i;
|
u16 Key = lookup_key(e->keyval);
|
||||||
u16 Key = 0;
|
ADD_KEY( Cur_Keypad, Key );
|
||||||
|
if(desmume_running()) update_keypad(Cur_Keypad);
|
||||||
for(i = 0; i < NB_KEYS; i++)
|
return 1;
|
||||||
if(e->keyval == keyboard_cfg[i]) break;
|
|
||||||
|
|
||||||
if(i < NB_KEYS)
|
|
||||||
{
|
|
||||||
ADD_KEY( Cur_Keypad, KEYMASK_(i) );
|
|
||||||
if(desmume_running()) update_keypad(Cur_Keypad);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint Key_Release(GtkWidget *w, GdkEventKey *e)
|
static gint Key_Release(GtkWidget *w, GdkEventKey *e)
|
||||||
{
|
{
|
||||||
int i;
|
u16 Key = lookup_key(e->keyval);
|
||||||
u16 Key = 0;
|
RM_KEY( Cur_Keypad, Key );
|
||||||
|
if(desmume_running()) update_keypad(Cur_Keypad);
|
||||||
for(i = 0; i < NB_KEYS; i++)
|
return 1;
|
||||||
if(e->keyval == keyboard_cfg[i]) break;
|
|
||||||
|
|
||||||
if(i < NB_KEYS)
|
|
||||||
{
|
|
||||||
RM_KEY( Cur_Keypad, KEYMASK_(i) );
|
|
||||||
if(desmume_running()) update_keypad(Cur_Keypad);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////// CONTROLS EDIT //////////////////////////////////////
|
/////////////////////////////// CONTROLS EDIT //////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue