First glimpse of joystick configuration.
Still hidden as it's not 100% working at the moment.
This commit is contained in:
parent
2d542a64c7
commit
3884a80f48
|
@ -335,3 +335,44 @@ void on_button_Start_clicked (GtkButton *b, gpointer user_data) { ask(b,DESMU
|
|||
void on_button_Select_clicked (GtkButton *b, gpointer user_data) { ask(b,DESMUME_KEY_Select); }
|
||||
void on_button_Debug_clicked (GtkButton *b, gpointer user_data) { ask(b,DESMUME_KEY_DEBUG); }
|
||||
void on_button_Boost_clicked (GtkButton *b, gpointer user_data) { ask(b,DESMUME_KEY_BOOST); }
|
||||
|
||||
/* Joystick configuration / Key definition */
|
||||
/* FIXME: popup is not shown!? */
|
||||
void ask_joy_key(GtkButton*b, int key)
|
||||
{
|
||||
char text[50];
|
||||
u16 joykey;
|
||||
|
||||
key--; /* remove 1 to get index */
|
||||
GtkDialog * dlg = (GtkDialog*)glade_xml_get_widget(xml, "wJoyDlg");
|
||||
GtkDialog * parent = (GtkDialog*)glade_xml_get_widget(xml, "wJoyConfDlg");
|
||||
gtk_widget_set_sensitive(parent, FALSE); /* Ugly workaround for bug below */
|
||||
gtk_widget_show_now(dlg);
|
||||
/* FIXME: when the following line is not commented, the widget is not even shown!! */
|
||||
joykey = get_set_joy_key(key);
|
||||
sprintf(text,"%s : %d\0\0",DESMUME_KEY_NAMES[key],joykey);
|
||||
gtk_button_set_label(b,text);
|
||||
gtk_widget_hide((GtkWidget*)dlg);
|
||||
gtk_widget_set_sensitive(parent, TRUE); /* Ugly workaround for bug below */
|
||||
}
|
||||
|
||||
void on_joy_button_A_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_A); }
|
||||
void on_joy_button_B_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_B); }
|
||||
void on_joy_button_X_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_X); }
|
||||
void on_joy_button_Y_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_Y); }
|
||||
void on_joy_button_L_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_L); }
|
||||
void on_joy_button_R_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_R); }
|
||||
void on_joy_button_Select_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_Select); }
|
||||
void on_joy_button_Start_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_Start); }
|
||||
void on_joy_button_Boost_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_BOOST); }
|
||||
void on_joy_button_Debug_clicked (GtkButton *b, gpointer user_data)
|
||||
{ ask_joy_key(b,DESMUME_KEY_DEBUG); }
|
||||
|
|
|
@ -63,3 +63,15 @@ void on_button_Start_clicked (GtkButton *button, gpointer user_data);
|
|||
void on_button_Select_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_button_Debug_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_button_Boost_clicked (GtkButton *button, gpointer user_data);
|
||||
|
||||
/* Joystick configuration / Key definition */
|
||||
void on_joy_button_Y_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_X_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_A_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_B_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_Select_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_L_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_R_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_Debug_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_Start_clicked (GtkButton *button, gpointer user_data);
|
||||
void on_joy_button_Boost_clicked (GtkButton *button, gpointer user_data);
|
||||
|
|
|
@ -1379,4 +1379,372 @@
|
|||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkDialog" id="wJoyConfDlg">
|
||||
<property name="title" translatable="yes">Joystick Config</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
<property name="icon">DeSmuME.xpm</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="response" handler="on_wKeybConfDlg_response" last_modification_time="Wed, 03 Jan 2007 19:09:39 GMT"/>
|
||||
<signal name="delete_event" handler="gtk_widget_hide_on_delete" last_modification_time="Wed, 03 Jan 2007 19:43:34 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="keybconf_cancel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-6</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="keybconf_ok">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-5</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTable" id="layout_keyb">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">5</property>
|
||||
<property name="n_columns">7</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="row_spacing">0</property>
|
||||
<property name="column_spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_Y">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Y : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_Y_clicked" last_modification_time="Tue, 02 Jan 2007 10:53:47 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="right_attach">5</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_X">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">X : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_X_clicked" last_modification_time="Tue, 02 Jan 2007 10:53:39 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="right_attach">6</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_A">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">A : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_A_clicked" last_modification_time="Tue, 02 Jan 2007 10:53:54 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">6</property>
|
||||
<property name="right_attach">7</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_B">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">B : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_B_clicked" last_modification_time="Tue, 02 Jan 2007 10:54:00 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="right_attach">6</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_Select">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Select : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_Select_clicked" last_modification_time="Tue, 02 Jan 2007 10:53:17 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_L">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">L : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_L_clicked" last_modification_time="Tue, 02 Jan 2007 10:52:28 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_R">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">R : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_R_clicked" last_modification_time="Tue, 02 Jan 2007 10:53:30 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">5</property>
|
||||
<property name="right_attach">7</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_DEBUG">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Debug : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_Debug_clicked" last_modification_time="Tue, 02 Jan 2007 11:44:01 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_Start">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Start : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_Start_clicked" last_modification_time="Tue, 02 Jan 2007 10:53:09 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_joy_Boost">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Boost : </property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<signal name="clicked" handler="on_joy_button_Boost_clicked" last_modification_time="Sat, 06 Jan 2007 13:54:50 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">4</property>
|
||||
<property name="right_attach">5</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_Axis">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Axis :</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkDialog" id="wJoyDlg">
|
||||
<property name="events">GDK_KEY_RELEASE_MASK</property>
|
||||
<property name="title" translatable="yes">Key definition</property>
|
||||
<property name="type">GTK_WINDOW_POPUP</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="icon">DeSmuME.xpm</property>
|
||||
<property name="decorated">False</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">False</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Press a button...</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
||||
|
|
Loading…
Reference in New Issue