diff options
| author | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-25 13:06:43 +0000 |
|---|---|---|
| committer | SND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-25 13:06:43 +0000 |
| commit | ee492d9e2f406dd2dca4804d2f86fe218d4b05ef (patch) | |
| tree | 1583b28a7aaaeb370ff09b6acb312ac05661dd97 | |
| parent | ba035beb7567360ca5a1e682898f56855931955c (diff) | |
| download | pcsxr-ee492d9e2f406dd2dca4804d2f86fe218d4b05ef.tar.gz | |
GTK: added "hide mouse cursor" feature. Enable/disable via dfinput config dialog's option tab.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86239 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rwxr-xr-x | plugins/dfinput/cfg-gtk.c | 12 | ||||
| -rw-r--r-- | plugins/dfinput/dfinput.ui | 15 | ||||
| -rwxr-xr-x | plugins/dfinput/pad.h | 2 | ||||
| -rwxr-xr-x | plugins/dfinput/xkb.c | 18 |
4 files changed, 33 insertions, 14 deletions
diff --git a/plugins/dfinput/cfg-gtk.c b/plugins/dfinput/cfg-gtk.c index d52d929d..a60a16a9 100755 --- a/plugins/dfinput/cfg-gtk.c +++ b/plugins/dfinput/cfg-gtk.c @@ -349,6 +349,7 @@ static void OnVisualVibration2Toggled(GtkWidget *widget, gpointer user_data) { } static void OnHideCursorToggled(GtkWidget *widget, gpointer user_data) { + (void)user_data; // unused g.cfg.HideCursor = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); } @@ -702,12 +703,11 @@ long PADconfigure() { g_signal_connect_data(G_OBJECT(widget), "toggled", G_CALLBACK(OnThreadedToggled), NULL, NULL, G_CONNECT_AFTER); -/* - widget = gtk_builder_get_object(xml, "checkcg"); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), g.cfg.HideCursor); - g_signal_connect_data(GTK_OBJECT(widget), "toggled", - G_CALLBACK(OnHideCursorToggled), NULL, NULL, G_CONNECT_AFTER); -*/ + widget = GTK_WIDGET(gtk_builder_get_object(xml, "checkcg")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), g.cfg.HideCursor); + g_signal_connect_data(G_OBJECT(widget), "toggled", + G_CALLBACK(OnHideCursorToggled), NULL, NULL, G_CONNECT_AFTER); + widget = GTK_WIDGET(gtk_builder_get_object(xml, widgetname_combodev[1])); g_signal_connect_data(G_OBJECT(widget), "changed", G_CALLBACK(OnDeviceChanged), GINT_TO_POINTER(0), NULL, G_CONNECT_AFTER); diff --git a/plugins/dfinput/dfinput.ui b/plugins/dfinput/dfinput.ui index 236b597a..df3b4606 100644 --- a/plugins/dfinput/dfinput.ui +++ b/plugins/dfinput/dfinput.ui @@ -679,6 +679,21 @@ <property name="position">0</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="checkcg"> + <property name="label" translatable="yes">Hide mouse cursor</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">3</property> diff --git a/plugins/dfinput/pad.h b/plugins/dfinput/pad.h index 671edf18..f7927214 100755 --- a/plugins/dfinput/pad.h +++ b/plugins/dfinput/pad.h @@ -217,7 +217,7 @@ enum { CMD_QUERY_ACT = 0x46, // ?? CMD_QUERY_COMB = 0x47, // ?? CMD_QUERY_MODE = 0x4C, // QUERY_MODE ?? - CMD_VIBRATION_TOGGLE = 0x4D, + CMD_VIBRATION_TOGGLE = 0x4D }; // cfg.c functions... diff --git a/plugins/dfinput/xkb.c b/plugins/dfinput/xkb.c index 616e722f..ed13c7c4 100755 --- a/plugins/dfinput/xkb.c +++ b/plugins/dfinput/xkb.c @@ -25,24 +25,26 @@ static int g_currentMouse_Y; static Window window; void InitKeyboard() { - wmprotocols = XInternAtom(g.Disp, "WM_PROTOCOLS", 0); - wmdelwindow = XInternAtom(g.Disp, "WM_DELETE_WINDOW", 0); + int revert_to; - XkbSetDetectableAutoRepeat(g.Disp, 1, NULL); + wmprotocols = XInternAtom(g.Disp, "WM_PROTOCOLS", 0); + wmdelwindow = XInternAtom(g.Disp, "WM_DELETE_WINDOW", 0); + XkbSetDetectableAutoRepeat(g.Disp, 1, NULL); + XGetInputFocus(g.Disp, &window, &revert_to); if (g.cfg.PadDef[0].Type == PSE_PAD_TYPE_MOUSE || g.cfg.PadDef[1].Type == PSE_PAD_TYPE_MOUSE) { - int revert_to; - XGetInputFocus(g.Disp, &window, &revert_to); grabCursor(g.Disp, window, 1); showCursor(g.Disp, window, 0); + } else if (g.cfg.HideCursor) { + showCursor(g.Disp, window, 0); } g_currentMouse_X = 0; g_currentMouse_Y = 0; - g.PadState[0].KeyStatus = 0xFFFF; - g.PadState[1].KeyStatus = 0xFFFF; + g.PadState[0].KeyStatus = 0xFFFF; + g.PadState[1].KeyStatus = 0xFFFF; } void DestroyKeyboard() { @@ -52,6 +54,8 @@ void DestroyKeyboard() { g.cfg.PadDef[1].Type == PSE_PAD_TYPE_MOUSE) { grabCursor(g.Disp, window, 0); showCursor(g.Disp, window, 1); + } else if (g.cfg.HideCursor) { + showCursor(g.Disp, window, 1); } } |
