| Copyright | (c) 20222026 L. S. Leary |
|---|---|
| License | BSD3-style (see LICENSE) |
| Maintainer | L.S.Leary.II@gmail.com |
| Stability | unstable |
| Portability | unportable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
XMonad.Actions.Repeatable
Contents
Description
This module factors out the shared logic of XMonad.Actions.CycleRecentWS, XMonad.Actions.CycleWorkspaceByScreen, XMonad.Actions.CycleWindows and XMonad.Actions.MostRecentlyUsed.
See the source of these modules for usage examples.
Synopsis
- repeatable :: [KeySym] -> KeySym -> (EventType -> KeySym -> X ()) -> X ()
- repeatableSt :: Monoid a => s -> [KeySym] -> KeySym -> (EventType -> KeySym -> StateT s X a) -> X (a, s)
- repeatableM :: (MonadIO m, Monoid a) => (m a -> X b) -> [KeySym] -> KeySym -> (EventType -> KeySym -> m a) -> X b
- data NotOurEvent = NotOurEvent
- data Done = Done
- concludable :: [KeySym] -> KeySym -> (EventType -> KeySym -> IO (Either NotOurEvent e)) -> (e -> X (Either Done ())) -> X ()
- concludableSt :: Monoid a => s -> [KeySym] -> KeySym -> (EventType -> KeySym -> IO (Either NotOurEvent e)) -> (e -> StateT s X (Either Done a)) -> X (a, s)
- concludableM :: (MonadIO m, Monoid a) => (m a -> X b) -> [KeySym] -> KeySym -> (EventType -> KeySym -> IO (Either NotOurEvent e)) -> (e -> m (Either Done a)) -> X b
Repeatable
Arguments
| :: [KeySym] | The list of |
| -> KeySym | The keypress that invokes the action. |
| -> (EventType -> KeySym -> X ()) | The keypress handler. |
| -> X () |
An action that temporarily usurps and responds to key press/release events, concluding when one of the modifier keys is released.
Arguments
| :: Monoid a | |
| => s | Initial state. |
| -> [KeySym] | The list of |
| -> KeySym | The keypress that invokes the action. |
| -> (EventType -> KeySym -> StateT s X a) | The keypress handler. |
| -> X (a, s) |
A more general variant of repeatable with a stateful handler,
accumulating a monoidal return value throughout the events.
Arguments
| :: (MonadIO m, Monoid a) | |
| => (m a -> X b) | How to run the monad in |
| -> [KeySym] | The list of |
| -> KeySym | The keypress that invokes the action. |
| -> (EventType -> KeySym -> m a) | The keypress handler. |
| -> X b |
A more general variant of repeatable with an arbitrary monadic handler,
accumulating a monoidal return value throughout the events.
Concludable
data NotOurEvent Source #
Constructors
| NotOurEvent |
Arguments
| :: [KeySym] | The list of |
| -> KeySym | The keypress that invokes the action. |
| -> (EventType -> KeySym -> IO (Either NotOurEvent e)) | Handle keypresses by translating them into custom events.
If the function produces |
| -> (e -> X (Either Done ())) | The custom event handler. |
| -> X () |
A generalisation of repeatable which may conclude early with NotOurEvent or Done.
Arguments
| :: Monoid a | |
| => s | Initial state. |
| -> [KeySym] | The list of |
| -> KeySym | The keypress that invokes the action. |
| -> (EventType -> KeySym -> IO (Either NotOurEvent e)) | Handle keypresses by translating them into custom events.
If the function produces |
| -> (e -> StateT s X (Either Done a)) | The custom event handler. |
| -> X (a, s) |
A more general variant of concludable with a stateful handler,
accumulating a monoidal return value throughout the events.
Arguments
| :: (MonadIO m, Monoid a) | |
| => (m a -> X b) | How to run the monad in |
| -> [KeySym] | The list of |
| -> KeySym | The keypress that invokes the action. |
| -> (EventType -> KeySym -> IO (Either NotOurEvent e)) | Handle keypresses by translating them into custom events.
If the function produces |
| -> (e -> m (Either Done a)) | The custom event handler. |
| -> X b |
A more general variant of concludable with an arbitrary monadic handler,
accumulating a monoidal return value throughout the events.