From 6c3218830b8c5d10185403ff5955418486a8864e Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sun, 16 Mar 2014 17:50:19 +0000 Subject: [PATCH] Fixed auto virtual keyboard for windows version --- src/computer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/computer.c b/src/computer.c index 1a882b0..b04a66d 100644 --- a/src/computer.c +++ b/src/computer.c @@ -1586,16 +1586,14 @@ inline void read_keyboard () { if ((!wd->ir.valid)&&(ordenador.vk_is_active)) virtkey_ir_deactivate(); #else int x=0,y=0 ; - SDL_GetRelativeMouseState(&x,&y); - if (x||y) + SDL_GetMouseState(&x,&y); + if ((x>64)&&(x<576)&&(y>90)&&(y<390)) { - ordenador.vk_is_active=1; - SDL_ShowCursor(SDL_ENABLE); + if (!ordenador.vk_is_active) virtkey_ir_activate(); } else { - ordenador.vk_is_active=0; - SDL_ShowCursor(SDL_DISABLE); + if (ordenador.vk_is_active) virtkey_ir_deactivate(); } #endif }