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 /plugins/dfinput/xkb.c | |
| 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
Diffstat (limited to 'plugins/dfinput/xkb.c')
| -rwxr-xr-x | plugins/dfinput/xkb.c | 18 |
1 files changed, 11 insertions, 7 deletions
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); } } |
