diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-12-20 21:08:36 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-12-20 21:28:42 +0530 |
| commit | d8667213fa49242701db4bf592754ab87749efa5 (patch) | |
| tree | 1431542c3a140e804ddbf58dc60d979c4542ede5 /src/Chelleport | |
| parent | 69f9c8ac053de7793c31c87572c9e044ae8369ee (diff) | |
| download | chelleport-d8667213fa49242701db4bf592754ab87749efa5.tar.gz chelleport-d8667213fa49242701db4bf592754ab87749efa5.zip | |
Add right mouse button click
Diffstat (limited to 'src/Chelleport')
| -rw-r--r-- | src/Chelleport/Control.hs | 5 | ||||
| -rw-r--r-- | src/Chelleport/Types.hs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Chelleport/Control.hs b/src/Chelleport/Control.hs index 38b6c53..2723cd2 100644 --- a/src/Chelleport/Control.hs +++ b/src/Chelleport/Control.hs @@ -20,13 +20,14 @@ instance (MonadIO m) => MonadControl (AppM m) where (DrawContext {ctxX11Display = display}) <- ask liftIO $ do -- Wrap with delay to prevent async window close issues. TODO: Remove maybe? - threadDelay 30_000 + threadDelay 20_000 X11.fakeButtonPress display x11Button X11.sync display False - threadDelay 30_000 + threadDelay 20_000 where x11Button = case btn of LeftClick -> X11.button1 + RightClick -> X11.button3 moveMousePointer x y = do DrawContext {ctxWindow = window} <- ask diff --git a/src/Chelleport/Types.hs b/src/Chelleport/Types.hs index 9752552..e648618 100644 --- a/src/Chelleport/Types.hs +++ b/src/Chelleport/Types.hs @@ -40,7 +40,7 @@ data DrawContext = DrawContext ctxX11Display :: X11.Display } -data MouseButtonType = LeftClick +data MouseButtonType = LeftClick | RightClick deriving (Show, Eq) newtype AppM m a = AppM {runAppM :: ReaderT DrawContext m a} |
