gi-gdk-3.0.29: Gdk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | Safe-Inferred
Language | Haskell2010

GI.Gdk.Structs.EventButton

Contents

- Exported types
- Methods
- Properties
  - axes
  - button
  - device
  - sendEvent
  - state
  - time
  - type
  - window
  - x
  - xRoot
  - y
  - yRoot

Description

Used for button press and button release events. The `type` field will be one of `EventTypeButtonPress`, `EventType2buttonPress`, `EventType3buttonPress` or `EventTypeButtonRelease`,

Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be:

- `EventTypeButtonPress`
- `EventTypeButtonRelease`
- `EventTypeButtonPress`
- `EventType2buttonPress`
- `EventTypeButtonRelease`

Note that the first click is received just like a normal button press, while the second click results in a `EventType2buttonPress` being received just after the `EventTypeButtonPress`.

Triple-clicks are very similar to double-clicks, except that `EventType3buttonPress` is inserted after the third click. The order of the events is:

- `EventTypeButtonPress`
- `EventTypeButtonRelease`
- `EventTypeButtonPress`
- `EventType2buttonPress`
- `EventTypeButtonRelease`
- `EventTypeButtonPress`
- `EventType3buttonPress`
- `EventTypeButtonRelease`

For a double click to occur, the second button press must occur within 1/4 of a second of the first. For a triple click to occur, the third button press must also occur within 1/2 second of the first button press.

Synopsis

- newtype EventButton = EventButton (ManagedPtr EventButton)
- newZeroEventButton :: MonadIO m => m EventButton
- getEventButtonAxes :: MonadIO m => EventButton -> m Double
- setEventButtonAxes :: MonadIO m => EventButton -> Double -> m ()
- getEventButtonButton :: MonadIO m => EventButton -> m Word32
- setEventButtonButton :: MonadIO m => EventButton -> Word32 -> m ()
- clearEventButtonDevice :: MonadIO m => EventButton -> m ()
- getEventButtonDevice :: MonadIO m => EventButton -> m (Maybe Device)
- setEventButtonDevice :: MonadIO m => EventButton -> Ptr Device -> m ()
- getEventButtonSendEvent :: MonadIO m => EventButton -> m Int8
- setEventButtonSendEvent :: MonadIO m => EventButton -> Int8 -> m ()
- getEventButtonState :: MonadIO m => EventButton -> m [ModifierType]
- setEventButtonState :: MonadIO m => EventButton -> [ModifierType] -> m ()
- getEventButtonTime :: MonadIO m => EventButton -> m Word32
- setEventButtonTime :: MonadIO m => EventButton -> Word32 -> m ()
- getEventButtonType :: MonadIO m => EventButton -> m EventType
- setEventButtonType :: MonadIO m => EventButton -> EventType -> m ()
- clearEventButtonWindow :: MonadIO m => EventButton -> m ()
- getEventButtonWindow :: MonadIO m => EventButton -> m (Maybe Window)
- setEventButtonWindow :: MonadIO m => EventButton -> Ptr Window -> m ()
- getEventButtonX :: MonadIO m => EventButton -> m Double
- setEventButtonX :: MonadIO m => EventButton -> Double -> m ()
- getEventButtonXRoot :: MonadIO m => EventButton -> m Double
- setEventButtonXRoot :: MonadIO m => EventButton -> Double -> m ()
- getEventButtonY :: MonadIO m => EventButton -> m Double
- setEventButtonY :: MonadIO m => EventButton -> Double -> m ()
- getEventButtonYRoot :: MonadIO m => EventButton -> m Double
- setEventButtonYRoot :: MonadIO m => EventButton -> Double -> m ()

# Exported types

newtype EventButton Source #

Memory-managed wrapper type.

Constructors

EventButton (ManagedPtr EventButton) |

#### Instances

Instances details

Eq EventButton Source # |
Instance details Defined in GI.Gdk.Structs.EventButton Methods (==) :: EventButton -> EventButton -> Bool Source # (/=) :: EventButton -> EventButton -> Bool Source #
BoxedPtr EventButton Source # |
Instance details Defined in GI.Gdk.Structs.EventButton Methods boxedPtrCopy :: EventButton -> IO EventButton Source # boxedPtrFree :: EventButton -> IO () Source #
CallocPtr EventButton Source # |
Instance details Defined in GI.Gdk.Structs.EventButton Methods boxedPtrCalloc :: IO (Ptr EventButton) Source #
ManagedPtrNewtype EventButton Source # |
Instance details Defined in GI.Gdk.Structs.EventButton Methods toManagedPtr :: EventButton -> ManagedPtr EventButton Source #
tag ~ 'AttrSet => Constructible EventButton tag Source # |
Instance details Defined in GI.Gdk.Structs.EventButton Methods new :: MonadIO m => (ManagedPtr EventButton -> EventButton) -> [AttrOp EventButton tag] -> m EventButton Source #

newZeroEventButton :: MonadIO m => m EventButton Source #

Construct a `EventButton` struct initialized to zero.

# Methods

# Properties

## axes

`x`, `y` translated to the axes of `device`, or `Nothing` if `device` is the mouse.

getEventButtonAxes :: MonadIO m => EventButton -> m Double Source #

Get the value of the “`axes`” field. When overloading is enabled, this is equivalent to

    get eventButton #axes

setEventButtonAxes :: MonadIO m => EventButton -> Double -> m () Source #

Set the value of the “`axes`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #axes := value ]

## button

the button which was pressed or released, numbered from 1 to 5. Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button. On 2-button mice, the middle button can often be simulated by pressing both mouse buttons together.

getEventButtonButton :: MonadIO m => EventButton -> m Word32 Source #

Get the value of the “`button`” field. When overloading is enabled, this is equivalent to

    get eventButton #button

setEventButtonButton :: MonadIO m => EventButton -> Word32 -> m () Source #

Set the value of the “`button`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #button := value ]

## device

the master device that the event originated from. Use `eventGetSourceDevice` to get the slave device.

clearEventButtonDevice :: MonadIO m => EventButton -> m () Source #

Set the value of the “`device`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #device

getEventButtonDevice :: MonadIO m => EventButton -> m (Maybe Device) Source #

Get the value of the “`device`” field. When overloading is enabled, this is equivalent to

    get eventButton #device

setEventButtonDevice :: MonadIO m => EventButton -> Ptr Device -> m () Source #

Set the value of the “`device`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #device := value ]

## sendEvent

`True` if the event was sent explicitly.

getEventButtonSendEvent :: MonadIO m => EventButton -> m Int8 Source #

Get the value of the “`send_event`” field. When overloading is enabled, this is equivalent to

    get eventButton #sendEvent

setEventButtonSendEvent :: MonadIO m => EventButton -> Int8 -> m () Source #

Set the value of the “`send_event`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #sendEvent := value ]

## state

a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See `ModifierType`.

getEventButtonState :: MonadIO m => EventButton -> m [ModifierType] Source #

Get the value of the “`state`” field. When overloading is enabled, this is equivalent to

    get eventButton #state

setEventButtonState :: MonadIO m => EventButton -> [ModifierType] -> m () Source #

Set the value of the “`state`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #state := value ]

## time

the time of the event in milliseconds.

getEventButtonTime :: MonadIO m => EventButton -> m Word32 Source #

Get the value of the “`time`” field. When overloading is enabled, this is equivalent to

    get eventButton #time

setEventButtonTime :: MonadIO m => EventButton -> Word32 -> m () Source #

Set the value of the “`time`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #time := value ]

## type

the type of the event (`EventTypeButtonPress`, `EventType2buttonPress`, `EventType3buttonPress` or `EventTypeButtonRelease`).

getEventButtonType :: MonadIO m => EventButton -> m EventType Source #

Get the value of the “`type`” field. When overloading is enabled, this is equivalent to

    get eventButton #type

setEventButtonType :: MonadIO m => EventButton -> EventType -> m () Source #

Set the value of the “`type`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #type := value ]

## window

the window which received the event.

clearEventButtonWindow :: MonadIO m => EventButton -> m () Source #

Set the value of the “`window`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #window

getEventButtonWindow :: MonadIO m => EventButton -> m (Maybe Window) Source #

Get the value of the “`window`” field. When overloading is enabled, this is equivalent to

    get eventButton #window

setEventButtonWindow :: MonadIO m => EventButton -> Ptr Window -> m () Source #

Set the value of the “`window`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #window := value ]

## x

the x coordinate of the pointer relative to the window.

getEventButtonX :: MonadIO m => EventButton -> m Double Source #

Get the value of the “`x`” field. When overloading is enabled, this is equivalent to

    get eventButton #x

setEventButtonX :: MonadIO m => EventButton -> Double -> m () Source #

Set the value of the “`x`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #x := value ]

## xRoot

the x coordinate of the pointer relative to the root of the screen.

getEventButtonXRoot :: MonadIO m => EventButton -> m Double Source #

Get the value of the “`x_root`” field. When overloading is enabled, this is equivalent to

    get eventButton #xRoot

setEventButtonXRoot :: MonadIO m => EventButton -> Double -> m () Source #

Set the value of the “`x_root`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #xRoot := value ]

## y

the y coordinate of the pointer relative to the window.

getEventButtonY :: MonadIO m => EventButton -> m Double Source #

Get the value of the “`y`” field. When overloading is enabled, this is equivalent to

    get eventButton #y

setEventButtonY :: MonadIO m => EventButton -> Double -> m () Source #

Set the value of the “`y`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #y := value ]

## yRoot

the y coordinate of the pointer relative to the root of the screen.

getEventButtonYRoot :: MonadIO m => EventButton -> m Double Source #

Get the value of the “`y_root`” field. When overloading is enabled, this is equivalent to

    get eventButton #yRoot

setEventButtonYRoot :: MonadIO m => EventButton -> Double -> m () Source #

Set the value of the “`y_root`” field. When overloading is enabled, this is equivalent to

    set eventButton [ #yRoot := value ]