diff options
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index af1893b..f9d8b1f 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -118,6 +118,7 @@ import qualified Rahm.Desktop.StackSet as W import Rahm.Desktop.Submap ( escape, mapNextString, + nextButtonOrKeyEvent, submap, submapButtonsWithKey, ) @@ -323,6 +324,12 @@ button14 = 14 button15 :: Button button15 = 15 +syntheticKeyMoveLeft :: KeySym +syntheticKeyMoveLeft = 0x1110000000000000 + +syntheticKeyMoveRight :: KeySym +syntheticKeyMoveRight = 0x1110000000000001 + mapWindows :: (Ord b) => (a -> b) -> W.StackSet i l a s sd -> W.StackSet i l b s sd mapWindows fn (W.StackSet cur vis hidden float) = W.StackSet @@ -1168,8 +1175,24 @@ bindings = do bind syntheticKeyStartDrag $ noMod $ - subbind $ do - bind button1 $ noMod $ noWindow D.dragWindow + runMaybeT_ $ do + ev <- nextButtonOrKeyEvent + lift $ do + click + mapM_ stylusMoveWindow . W.peek =<< gets windowset + + bind syntheticKeyStartResize $ + noMod $ + runMaybeT_ $ do + ev <- nextButtonOrKeyEvent + lift $ do + click + mapM_ stylusResizeWindow . W.peek =<< gets windowset + + -- subbind $ do + -- bind button1 $ noMod $ noWindow $ do + -- logs Info "Start drag!" + -- D.dragWindow let button14Binder = do bind button3 $ @@ -1454,7 +1477,11 @@ rdeBasicCommandHandler = SyntheticKeySym mask keySym -> do logs Info "Got synthetic keysym mask %s %s" (show mask) (show keySym) keyMap <- asks (\c -> keys (config c) (config c)) - sequence_ $ Map.lookup (mask, keySym) keyMap + logs Info "Got keymap" + sequence_ $ + (logs Info "running command" >>) + <$> Map.lookup (mask, keySym) keyMap + logs Info "Finished thing" ToNextLayout -> sendMessage toNextLayout ) @@ -1474,6 +1501,25 @@ cornersConfig = myMouseMoveWindow = myMouseMoveWindows . Identity +stylusMoveWindow :: Window -> X () +stylusMoveWindow w = + D.mouseMoveWindowsAndThen + (mapM_ X.focus) + ( mconcat + [ D.ifReleased button2 D.sinkOnRelease + ] + ) + [w] + +stylusResizeWindow :: Window -> X () +stylusResizeWindow = + D.mouseResizeWindowAndThen + X.focus + ( mconcat + [ D.ifReleased button2 D.sinkOnRelease + ] + ) + myMouseMoveWindows :: (Foldable f) => f Window -> X () myMouseMoveWindows = D.mouseMoveWindowsAndThen |