From 313faa07d7a0083a35288b73e8db771918b0714f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 22 Dec 2014 10:42:49 -0500 Subject: [PATCH] lib/sdl: intro `has_mouse|input_focus` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/sdl.nit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/sdl.nit b/lib/sdl.nit index 446e347..6de6d2d 100644 --- a/lib/sdl.nit +++ b/lib/sdl.nit @@ -181,6 +181,12 @@ extern class SDLDisplay `{SDL_Surface *`} fun ignore_mouse_motion_events=(val: Bool) `{ SDL_EventState(SDL_MOUSEMOTION, val? SDL_IGNORE: SDL_ENABLE); `} + + # Does `self` has the mouse focus? + fun mouse_focus: Bool `{ return SDL_GetAppState() & SDL_APPMOUSEFOCUS; `} + + # Does `self` has the input focus? + fun input_focus: Bool `{ return SDL_GetAppState() & SDL_APPINPUTFOCUS; `} end # Basic Drawing figures -- 1.7.9.5