gi-gdk-4.0.1: 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 #

GObject Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

Methods

gobjectType :: IO GType #

IsGValue Event Source #

Convert Event to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Objects.Event

HasParentTypes Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

type ParentTypes Event Source # 
Instance details

Defined in GI.Gdk.Objects.Event

class (GObject 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
(GObject 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.

noEvent :: Maybe Event Source #

A convenience alias for Nothing :: Maybe Event.

Methods

Overloaded methods

copy

eventCopy Source #

Arguments

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

event: a GdkEvent

-> m Event

Returns: a copy of event. Free with objectUnref

Copies a GdkEvent, copying or incrementing the reference count of the resources associated with it (e.g. Surface’s and strings).

getAxes

eventGetAxes Source #

Arguments

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

event: a GdkEvent

-> 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 GdkEvent

-> 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.

getButton

eventGetButton Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32)

Returns: True if the event delivered a button number

Extract the button number from an event.

getClickCount

eventGetClickCount Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32)

Returns: True if the event delivered a click count

Extracts the click count from an event.

getCoords

eventGetCoords Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Double, Double)

Returns: True if the event delivered event surface coordinates

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

getCrossingDetail

eventGetCrossingDetail Source #

Arguments

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

event: a GdkEvent

-> m (Bool, NotifyType)

Returns: True on success, otherwise False

Extracts the crossing detail from an event.

getCrossingMode

eventGetCrossingMode Source #

Arguments

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

event: a GdkEvent

-> m (Bool, CrossingMode)

Returns: True on success, otherwise False

Extracts the crossing mode from an event.

getDevice

eventGetDevice Source #

Arguments

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

event: a GdkEvent.

-> m (Maybe Device)

Returns: a Device, or Nothing.

If the event contains a “device” field, this function will return it, else it will return Nothing.

getDeviceTool

eventGetDeviceTool Source #

Arguments

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

event: a GdkEvent

-> m 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 DeviceTools 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 GdkEvent

-> m (Maybe Display)

Returns: a Display

Retrieves the Display associated to the event.

getDrop

eventGetDrop Source #

Arguments

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

event: a GdkEvent

-> m (Maybe Drop)

Returns: the drop

Gets the Drop from a DND event.

getEventSequence

eventGetEventSequence Source #

Arguments

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

event: a GdkEvent

-> m EventSequence

Returns: the event sequence that the event belongs to

If event if of type EventTypeTouchBegin, EventTypeTouchUpdate, EventTypeTouchEnd or EventTypeTouchCancel, returns the EventSequence to which the event belongs. Otherwise, return Nothing.

getEventType

eventGetEventType Source #

Arguments

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

event: a GdkEvent

-> m EventType

Returns: a EventType

Retrieves the type of the event.

getFocusIn

eventGetFocusIn Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Bool)

Returns: True on success, otherwise False

Extracts whether this is a focus-in or focus-out event.

getGrabSurface

eventGetGrabSurface Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Surface)

Returns: True on success, otherwise False

Extracts the grab surface from a grab broken event.

getKeyGroup

eventGetKeyGroup Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32)

Returns: True on success, otherwise False

Extracts the key group from an event.

getKeyIsModifier

eventGetKeyIsModifier Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Bool)

Returns: True on success, otherwise False

Extracts whether the event is a key event for a modifier key.

getKeycode

eventGetKeycode Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word16)

Returns: True if the event delivered a hardware keycode

Extracts the hardware keycode from an event.

Also see eventGetScancode.

getKeyval

eventGetKeyval Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32)

Returns: True if the event delivered a key symbol

Extracts the keyval from an event.

getMotionHistory

eventGetMotionHistory Source #

Arguments

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

event: a GdkEvent of type EventTypeMotionNotify

-> m [TimeCoord]

Returns: a list of time and coordinates

Retrieves the history of the event motion, as a list of time and coordinates.

getPadAxisValue

eventGetPadAxisValue Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32, Double)

Returns: True on success, otherwise False

Extracts the information from a pad event.

getPadButton

eventGetPadButton Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32)

Returns: True on success, otherwise False

Extracts information about the pressed button from a pad event.

getPadGroupMode

eventGetPadGroupMode Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32, Word32)

Returns: True on success, otherwise False

Extracts group and mode information from a pad event.

getPointerEmulated

eventGetPointerEmulated Source #

Arguments

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

event: a GdkEvent

-> 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.

getRootCoords

eventGetRootCoords Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Double, Double)

Returns: True if the event delivered root window coordinates

Extract the root window relative x/y coordinates from an event.

getScancode

eventGetScancode Source #

Arguments

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

event: a GdkEvent

-> m Int32

Returns: The associated keyboard scancode or 0

Gets the keyboard low-level scancode of a key event.

This is usually hardware_keycode. On Windows this is the high word of WM_KEY{DOWN,UP} lParam which contains the scancode and some extended flags.

getScrollDeltas

eventGetScrollDeltas Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Double, Double)

Returns: True if the event contains smooth scroll information

Retrieves the scroll deltas from a GdkEvent

getScrollDirection

eventGetScrollDirection Source #

Arguments

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

event: a GdkEvent

-> m (Bool, ScrollDirection)

Returns: True if the event delivered a scroll direction

Extracts the scroll direction from an event.

getSeat

eventGetSeat Source #

Arguments

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

event: a GdkEvent

-> m Seat

Returns: The Seat of this event

Returns the Seat this event was generated for.

getSourceDevice

eventGetSourceDevice Source #

Arguments

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

event: a GdkEvent

-> 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.

getState

eventGetState Source #

Arguments

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

event: a GdkEvent or Nothing

-> m (Bool, [ModifierType])

Returns: True if there was a state field in the event

If the event contains a “state” field, puts that field in state.

Otherwise stores an empty state (0). event may be Nothing, in which case it’s treated as if the event had no state field.

getSurface

eventGetSurface Source #

Arguments

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

event: a GdkEvent

-> 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 GdkEvent

-> m Word32

Returns: time stamp field from event

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

getTouchEmulatingPointer

eventGetTouchEmulatingPointer Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Bool)

Returns: True on success, otherwise False

Extracts whether a touch event is emulating a pointer event.

getTouchpadAngleDelta

eventGetTouchpadAngleDelta Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Double)

Returns: True on success, otherwise False

Extracts the angle from a touchpad event.

getTouchpadDeltas

eventGetTouchpadDeltas Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Double, Double)

Returns: True on success, otherwise False

Extracts delta information from a touchpad event.

getTouchpadGestureNFingers

eventGetTouchpadGestureNFingers Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Word32)

Returns: True on success, otherwise False

Extracts the number of fingers from a touchpad event.

getTouchpadGesturePhase

eventGetTouchpadGesturePhase Source #

Arguments

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

event: a GdkEvent

-> m (Bool, TouchpadGesturePhase)

Returns: True on success, otherwise False

Extracts the touchpad gesture phase from a touchpad event.

getTouchpadScale

eventGetTouchpadScale Source #

Arguments

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

event: a GdkEvent

-> m (Bool, Double)

Returns: True on success, otherwise False

Extracts the scale from a touchpad event.

isScrollStopEvent

eventIsScrollStopEvent Source #

Arguments

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

event: a GdkEvent

-> m Bool

Returns: True if the event is a scroll stop event

Check whether a scroll event is a stop scroll event. Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity.

Stop scroll events always have a a delta of 0/0.

isSent

eventIsSent Source #

Arguments

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

event: a GdkEvent

-> m Bool

Returns: True if the event was sent explicitly

Returns whether the event was sent explicitly.

new

eventNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> EventType

type: a EventType

-> m Event

Returns: a newly-allocated GdkEvent. Free with objectUnref

Creates a new event of the given type. All fields are set to 0.

setCoords

eventSetCoords :: (HasCallStack, MonadIO m, IsEvent a) => a -> Double -> Double -> m () Source #

No description available in the introspection data.

setDevice

eventSetDevice Source #

Arguments

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

event: a GdkEvent

-> b

device: a Device

-> m () 

Sets the device for event to device. The event must have been allocated by GTK+, for instance, by eventCopy.

setDeviceTool

eventSetDeviceTool Source #

Arguments

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

event: a GdkEvent

-> Maybe b

tool: tool to set on the event, or Nothing

-> m () 

Sets the device tool for this event, should be rarely used.

setDisplay

eventSetDisplay Source #

Arguments

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

event: a GdkEvent

-> b

display: a Display

-> m () 

Sets the display that an event is associated with.

setKeyval

eventSetKeyval :: (HasCallStack, MonadIO m, IsEvent a) => a -> Word32 -> m () Source #

No description available in the introspection data.

setSourceDevice

eventSetSourceDevice Source #

Arguments

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

event: a GdkEvent

-> b

device: a Device

-> m () 

Sets the slave device for event to device.

The event must have been allocated by GTK+, for instance by eventCopy.

triggersContextMenu

eventTriggersContextMenu Source #

Arguments

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

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

-> m Bool

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

This function returns whether a EventButton should trigger a context menu, according to platform conventions. The right mouse button always triggers context menus. Additionally, if keymapGetModifierMask returns a non-0 mask for ModifierIntentContextMenu, then the left mouse button will also trigger a context menu if this modifier is pressed.

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

Properties

eventType

No description available in the introspection data.

constructEventEventType :: IsEvent o => EventType -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “event-type” property. This is rarely needed directly, but it is used by new.

getEventEventType :: (MonadIO m, IsEvent o) => o -> m EventType Source #

Get the value of the “event-type” property. When overloading is enabled, this is equivalent to

get event #eventType