Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Core functions for SDL event processing and conversion.
Synopsis
- data ConvertEventsCfg = ConvertEventsCfg {
- _cecOs :: Text
- _cecDpr :: Double
- _cecEpr :: Double
- _cecInvertWheelX :: Bool
- _cecInvertWheelY :: Bool
- isActionEvent :: EventPayload -> Bool
- convertEvents :: ConvertEventsCfg -> Point -> [EventPayload] -> [SystemEvent]
- translateEvent :: Point -> SystemEvent -> SystemEvent
Documentation
data ConvertEventsCfg Source #
Configuration options for converting from an SDL event to a SystemEvent
.
ConvertEventsCfg | |
|
Instances
Eq ConvertEventsCfg Source # | |
Defined in Monomer.Event.Core (==) :: ConvertEventsCfg -> ConvertEventsCfg -> Bool # (/=) :: ConvertEventsCfg -> ConvertEventsCfg -> Bool # | |
Show ConvertEventsCfg Source # | |
Defined in Monomer.Event.Core showsPrec :: Int -> ConvertEventsCfg -> ShowS # show :: ConvertEventsCfg -> String # showList :: [ConvertEventsCfg] -> ShowS # |
isActionEvent :: EventPayload -> Bool Source #
Checks if an SDL event is an action event. Currently only mouse and keyboard events are considered as such (touch events should be added in the future). This is used for triggering automatic rendering of a frame. For other events, widgets must request rendering explicitly.
:: ConvertEventsCfg | Settings for event conversion. |
-> Point | Mouse position. |
-> [EventPayload] | List of SDL events. |
-> [SystemEvent] | List of Monomer events. |
Converts SDL events to Monomer's SystemEvent
:: Point | Offset to apply |
-> SystemEvent | Source SystemEvent |
-> SystemEvent | Updated SystemEvent |
Adds a given offset to mouse related SystemEvents.