From b5028ef614b37255bad1997fa940bf9e0cb5d4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 3 Apr 2014 12:50:30 +0200 Subject: Add sdl_window:is_input_grabbed/1 --- src/esdl2.erl | 4 ++++ src/sdl_window.erl | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/esdl2.erl b/src/esdl2.erl index bec4d72..3c996fb 100644 --- a/src/esdl2.erl +++ b/src/esdl2.erl @@ -76,6 +76,7 @@ -export([get_window_brightness/1]). -export([get_window_display_index/1]). -export([get_window_flags/1]). +-export([get_window_grab/1]). %% @todo We probably want to accept an env variable or somthing for the location. -on_load(on_load/0). @@ -233,3 +234,6 @@ get_window_display_index(_) -> get_window_flags(_) -> erlang:nif_error({not_loaded, ?MODULE}). + +get_window_grab(_) -> + erlang:nif_error({not_loaded, ?MODULE}). diff --git a/src/sdl_window.erl b/src/sdl_window.erl index 02e9474..bc77974 100644 --- a/src/sdl_window.erl +++ b/src/sdl_window.erl @@ -19,6 +19,7 @@ -export([get_brightness/1]). -export([get_display_index/1]). -export([get_flags/1]). +-export([is_input_grabbed/1]). create(Title, X, Y, W, H, Flags) -> esdl2:create_window(Title, X, Y, W, H, Flags), @@ -42,3 +43,7 @@ get_display_index(Window) -> get_flags(Window) -> esdl2:get_window_flags(Window), receive {'_nif_thread_ret_', Ret} -> Ret end. + +is_input_grabbed(Window) -> + esdl2:get_window_grab(Window), + receive {'_nif_thread_ret_', Ret} -> Ret end. -- cgit v1.2.3