diff options
Diffstat (limited to 'src/Wetterhorn/FFI.hs')
-rw-r--r-- | src/Wetterhorn/FFI.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Wetterhorn/FFI.hs b/src/Wetterhorn/FFI.hs index 58c1aff..4be7189 100644 --- a/src/Wetterhorn/FFI.hs +++ b/src/Wetterhorn/FFI.hs @@ -20,6 +20,7 @@ import Foreign.C (CChar, CInt (..)) import System.Posix.Types (CIno) import Wetterhorn.Core import Wetterhorn.Core.ForeignInterface +import Wetterhorn.WlRoots (WlrEventKeyboardKey, WlrInputDevice) runForeign :: (WConfig -> W ()) -> Wetterhorn -> IO Wetterhorn runForeign fn stblptr = do @@ -85,7 +86,8 @@ pluginMarshalState stblptr outlen = do foreign export ccall "plugin_handle_keybinding" pluginHandleKeybinding :: - Ptr () -> + Ptr WlrInputDevice -> + Ptr WlrEventKeyboardKey -> Word32 -> Word32 -> Word32 -> @@ -94,14 +96,15 @@ foreign export ccall "plugin_handle_keybinding" IO Wetterhorn pluginHandleKeybinding :: - Ptr () -> + Ptr WlrInputDevice -> + Ptr WlrEventKeyboardKey -> Word32 -> Word32 -> Word32 -> Ptr CInt -> Wetterhorn -> IO Wetterhorn -pluginHandleKeybinding eventPtr mods sym cp = +pluginHandleKeybinding inputDevicePtr eventPtr mods sym cp = runForeignWithReturn $ \config -> do event <- wio $ runForeignDemarshal eventPtr $ do @@ -117,6 +120,7 @@ pluginHandleKeybinding eventPtr mods sym cp = mods sym (toEnum $ fromIntegral cp) + inputDevicePtr (\b -> if b then 1 else 0) <$> keybindingHandler config event foreign export ccall "plugin_handle_surface_map" |