gi-gdk-4.0.2: Gdk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.Event

Description

The GdkEvent struct contains only private fields and should not be accessed directly.

Synopsis

Exported types

newtype Event Source #

Memory-managed wrapper type.

Constructors

Event (ManagedPtr Event) 

Instances

Instances details
Eq Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

Methods

(==) :: Event -> Event -> Bool #

(/=) :: Event -> Event -> Bool #

ManagedPtrNewtype Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

BoxedPtr Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

TypedObject Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

Methods

glibType :: IO GType #

HasParentTypes Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

type ParentTypes Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

type ParentTypes Event = '[] :: [Type]

class (BoxedPtr o, TypedObject o, IsDescendantOf Event o) => IsEvent o Source #

Type class for types which can be safely cast to Event, for instance with toEvent.

Instances

Instances details
(BoxedPtr o, TypedObject o, IsDescendantOf Event o) => IsEvent o Source # 
Instance details

Defined in GI.Gdk.Objects.Event

toEvent :: (MonadIO m, IsEvent o) => o -> m Event Source #

Cast to Event, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getAxes

eventGetAxes Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m (Bool, [Double])

Returns: True on success, otherwise False

Extracts all axis values from an event.

getAxis

eventGetAxis Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> AxisUse

axisUse: the axis use to look for

-> m (Bool, Double)

Returns: True if the specified axis was found, otherwise False

Extract the axis value for a particular axis use from an event structure.

getDevice

eventGetDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event.

-> m (Maybe Device)

Returns: a Device.

Returns the device of an event.

getDeviceTool

eventGetDeviceTool Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m (Maybe DeviceTool)

Returns: The current device tool, or Nothing

If the event was generated by a device that supports different tools (eg. a tablet), this function will return a DeviceTool representing the tool that caused the event. Otherwise, Nothing will be returned.

Note: the GdkDeviceTools will be constant during the application lifetime, if settings must be stored persistently across runs, see deviceToolGetSerial

getDisplay

eventGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m (Maybe Display)

Returns: a Display

Retrieves the Display associated to the event.

getEventSequence

eventGetEventSequence Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m EventSequence

Returns: the event sequence that the event belongs to

If event is a touch event, returns the EventSequence to which the event belongs. Otherwise, return Nothing.

getEventType

eventGetEventType Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m EventType

Returns: a EventType

Retrieves the type of the event.

getModifierState

eventGetModifierState Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m [ModifierType]

Returns: the modifier state of event

Returns the modifier state field of an event.

getPointerEmulated

eventGetPointerEmulated Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m Bool

Returns: True if this event is emulated

Returns whether this event is an 'emulated' pointer event (typically from a touch event), as opposed to a real one.

getPosition

eventGetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m (Bool, Double, Double) 

Extract the event surface relative x/y coordinates from an event.

getSourceDevice

eventGetSourceDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m (Maybe Device)

Returns: a Device, or Nothing.

This function returns the hardware (slave) Device that has triggered the event, falling back to the virtual (master) device (as in eventGetDevice) if the event wasn’t caused by interaction with a hardware device. This may happen for example in synthesized crossing events after a Surface updates its geometry or a grab is acquired/released.

If the event does not contain a device field, this function will return Nothing.

getSurface

eventGetSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m Surface

Returns: The Surface associated with the event

Extracts the Surface associated with an event.

getTime

eventGetTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m Word32

Returns: time stamp field from event

Returns the time stamp from event, if there is one; otherwise returns CURRENT_TIME.

ref

eventRef Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m Event

Returns: event

Increase the ref count of event.

triggersContextMenu

eventTriggersContextMenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event, currently only button events are meaningful values

-> m Bool

Returns: True if the event should trigger a context menu.

This function returns whether a GdkEventButton should trigger a context menu, according to platform conventions. The right mouse button always triggers context menus.

This function should always be used instead of simply checking for event->button == BUTTON_SECONDARY.

unref

eventUnref Source #

Arguments

:: (HasCallStack, MonadIO m, IsEvent a) 
=> a

event: a Event

-> m () 

Decrease the ref count of event, and free it if the last reference is dropped.