gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.EventControllerKey

Description

GtkEventControllerKey is an event controller that provides access to key events.

Synopsis

Exported types

newtype EventControllerKey Source #

Memory-managed wrapper type.

Constructors

EventControllerKey (ManagedPtr EventControllerKey) 

Instances

Instances details
Eq EventControllerKey Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

GObject EventControllerKey Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

ManagedPtrNewtype EventControllerKey Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

TypedObject EventControllerKey Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

Methods

glibType :: IO GType

HasParentTypes EventControllerKey Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

IsGValue (Maybe EventControllerKey) Source #

Convert EventControllerKey to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.EventControllerKey

type ParentTypes EventControllerKey Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

type ParentTypes EventControllerKey = '[EventController, Object]

class (GObject o, IsDescendantOf EventControllerKey o) => IsEventControllerKey o Source #

Type class for types which can be safely cast to EventControllerKey, for instance with toEventControllerKey.

Instances

Instances details
(GObject o, IsDescendantOf EventControllerKey o) => IsEventControllerKey o Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

toEventControllerKey :: (MonadIO m, IsEventControllerKey o) => o -> m EventControllerKey Source #

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

Methods

forward

eventControllerKeyForward Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerKey a, IsWidget b) 
=> a

controller: a GtkEventControllerKey

-> b

widget: a GtkWidget

-> m Bool

Returns: whether the widget handled the event

Forwards the current event of this controller to a widget.

This function can only be used in handlers for the EventControllerKey::keyPressed, EventControllerKey::keyReleased or EventControllerKey::modifiers signals.

getGroup

eventControllerKeyGetGroup Source #

Arguments

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

controller: a GtkEventControllerKey

-> m Word32

Returns: the key group

Gets the key group of the current event of this controller.

See keyEventGetLayout.

getImContext

eventControllerKeyGetImContext Source #

Arguments

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

controller: a GtkEventControllerKey

-> m (Maybe IMContext)

Returns: the GtkIMContext

Gets the input method context of the key controller.

new

eventControllerKeyNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m EventControllerKey

Returns: a new GtkEventControllerKey

Creates a new event controller that will handle key events.

setImContext

eventControllerKeySetImContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerKey a, IsIMContext b) 
=> a

controller: a GtkEventControllerKey

-> Maybe b

imContext: a GtkIMContext

-> m () 

Sets the input method context of the key controller.

Signals

imUpdate

type EventControllerKeyImUpdateCallback = IO () Source #

Emitted whenever the input method context filters away a keypress and prevents the controller receiving it.

See eventControllerKeySetImContext and iMContextFilterKeypress.

afterEventControllerKeyImUpdate :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyImUpdateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the imUpdate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #imUpdate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onEventControllerKeyImUpdate :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyImUpdateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the imUpdate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #imUpdate callback

keyPressed

type EventControllerKeyKeyPressedCallback Source #

Arguments

 = Word32

keyval: the pressed key.

-> Word32

keycode: the raw code of the pressed key.

-> [ModifierType]

state: the bitmask, representing the state of modifier keys and pointer buttons. See GdkModifierType.

-> IO Bool

Returns: True if the key press was handled, False otherwise.

Emitted whenever a key is pressed.

afterEventControllerKeyKeyPressed :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyKeyPressedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the keyPressed signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #keyPressed callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onEventControllerKeyKeyPressed :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyKeyPressedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the keyPressed signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #keyPressed callback

keyReleased

type EventControllerKeyKeyReleasedCallback Source #

Arguments

 = Word32

keyval: the released key.

-> Word32

keycode: the raw code of the released key.

-> [ModifierType]

state: the bitmask, representing the state of modifier keys and pointer buttons. See GdkModifierType.

-> IO () 

Emitted whenever a key is released.

afterEventControllerKeyKeyReleased :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyKeyReleasedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the keyReleased signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #keyReleased callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onEventControllerKeyKeyReleased :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyKeyReleasedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the keyReleased signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #keyReleased callback

modifiers

type EventControllerKeyModifiersCallback Source #

Arguments

 = [ModifierType]

keyval: the released key.

-> IO Bool 

Emitted whenever the state of modifier keys and pointer buttons change.

afterEventControllerKeyModifiers :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyModifiersCallback) -> m SignalHandlerId Source #

Connect a signal handler for the modifiers signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #modifiers callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onEventControllerKeyModifiers :: (IsEventControllerKey a, MonadIO m) => a -> ((?self :: a) => EventControllerKeyModifiersCallback) -> m SignalHandlerId Source #

Connect a signal handler for the modifiers signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #modifiers callback