monomer-1.5.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Event.Core

Description

Core functions for SDL event processing and conversion.

Synopsis

Documentation

data ConvertEventsCfg Source #

Configuration options for converting from an SDL event to a SystemEvent.

Constructors

ConvertEventsCfg 

Fields

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.

convertEvents Source #

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

translateEvent Source #

Arguments

:: Point

Offset to apply

-> SystemEvent

Source SystemEvent

-> SystemEvent

Updated SystemEvent

Adds a given offset to mouse related SystemEvents.