Add wantCaptureMouse, wantCaptureKeyboard (#54)

This commit is contained in:
Alexander Bondarenko 2021-05-03 12:57:23 +03:00 committed by GitHub
parent 8723ac2625
commit 5cdce50c3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -187,6 +187,8 @@ module DearImGui
-- * Item/Widgets Utilities
, Raw.isItemHovered
, Raw.wantCaptureMouse
, Raw.wantCaptureKeyboard
-- * Types
, module DearImGui.Enums

View File

@ -156,6 +156,8 @@ module DearImGui.Raw
-- * Item/Widgets Utilities
, isItemHovered
, wantCaptureMouse
, wantCaptureKeyboard
-- * Types
, module DearImGui.Enums
@ -873,3 +875,11 @@ pushStyleVar style valPtr = liftIO do
popStyleVar :: (MonadIO m) => CInt -> m ()
popStyleVar n = liftIO do
[C.exp| void { PopStyleVar($(int n)) } |]
wantCaptureMouse :: MonadIO m => m Bool
wantCaptureMouse = liftIO do
(0 /=) <$> [C.exp| bool { GetIO().WantCaptureMouse } |]
wantCaptureKeyboard :: MonadIO m => m Bool
wantCaptureKeyboard = liftIO do
(0 /=) <$> [C.exp| bool { GetIO().WantCaptureKeyboard } |]