Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Monomer.Event.Core
Description
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
.
Constructors
ConvertEventsCfg | |
Fields
|
Instances
Show ConvertEventsCfg Source # | |
Defined in Monomer.Event.Core Methods showsPrec :: Int -> ConvertEventsCfg -> ShowS # show :: ConvertEventsCfg -> String # showList :: [ConvertEventsCfg] -> ShowS # | |
Eq ConvertEventsCfg Source # | |
Defined in Monomer.Event.Core Methods (==) :: ConvertEventsCfg -> ConvertEventsCfg -> Bool # (/=) :: ConvertEventsCfg -> ConvertEventsCfg -> Bool # |
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.
Arguments
:: 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
Arguments
:: Point | Offset to apply |
-> SystemEvent | Source SystemEvent |
-> SystemEvent | Updated SystemEvent |
Adds a given offset to mouse related SystemEvents.