nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2fae06
)
lib/sdl: intro `has_mouse|input_focus`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 22 Dec 2014 15:42:49 +0000
(10:42 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 27 Jan 2015 03:08:06 +0000
(22:08 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/sdl.nit
patch
|
blob
|
history
diff --git
a/lib/sdl.nit
b/lib/sdl.nit
index
446e347
..
6de6d2d
100644
(file)
--- 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