Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Describes a key press or key release event.
Synopsis
- newtype EventKey = EventKey (ManagedPtr EventKey)
- newZeroEventKey :: MonadIO m => m EventKey
- noEventKey :: Maybe EventKey
- getEventKeyGroup :: MonadIO m => EventKey -> m Word8
- setEventKeyGroup :: MonadIO m => EventKey -> Word8 -> m ()
- getEventKeyHardwareKeycode :: MonadIO m => EventKey -> m Word16
- setEventKeyHardwareKeycode :: MonadIO m => EventKey -> Word16 -> m ()
- getEventKeyIsModifier :: MonadIO m => EventKey -> m Word32
- setEventKeyIsModifier :: MonadIO m => EventKey -> Word32 -> m ()
- getEventKeyKeyval :: MonadIO m => EventKey -> m Word32
- setEventKeyKeyval :: MonadIO m => EventKey -> Word32 -> m ()
- getEventKeyLength :: MonadIO m => EventKey -> m Int32
- setEventKeyLength :: MonadIO m => EventKey -> Int32 -> m ()
- getEventKeySendEvent :: MonadIO m => EventKey -> m Int8
- setEventKeySendEvent :: MonadIO m => EventKey -> Int8 -> m ()
- getEventKeyState :: MonadIO m => EventKey -> m [ModifierType]
- setEventKeyState :: MonadIO m => EventKey -> [ModifierType] -> m ()
- clearEventKeyString :: MonadIO m => EventKey -> m ()
- getEventKeyString :: MonadIO m => EventKey -> m (Maybe Text)
- setEventKeyString :: MonadIO m => EventKey -> CString -> m ()
- getEventKeyTime :: MonadIO m => EventKey -> m Word32
- setEventKeyTime :: MonadIO m => EventKey -> Word32 -> m ()
- getEventKeyType :: MonadIO m => EventKey -> m EventType
- setEventKeyType :: MonadIO m => EventKey -> EventType -> m ()
- clearEventKeyWindow :: MonadIO m => EventKey -> m ()
- getEventKeyWindow :: MonadIO m => EventKey -> m (Maybe Window)
- setEventKeyWindow :: MonadIO m => EventKey -> Ptr Window -> m ()
Exported types
Memory-managed wrapper type.
Instances
WrappedPtr EventKey Source # | |
Defined in GI.Gdk.Structs.EventKey wrappedPtrCalloc :: IO (Ptr EventKey) # wrappedPtrCopy :: EventKey -> IO EventKey # | |
tag ~ AttrSet => Constructible EventKey tag Source # | |
Defined in GI.Gdk.Structs.EventKey |
Properties
group
the keyboard group.
getEventKeyGroup :: MonadIO m => EventKey -> m Word8 Source #
Get the value of the “group
” field.
When overloading is enabled, this is equivalent to
get
eventKey #group
setEventKeyGroup :: MonadIO m => EventKey -> Word8 -> m () Source #
Set the value of the “group
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #group:=
value ]
hardwareKeycode
the raw code of the key that was pressed or released.
getEventKeyHardwareKeycode :: MonadIO m => EventKey -> m Word16 Source #
Get the value of the “hardware_keycode
” field.
When overloading is enabled, this is equivalent to
get
eventKey #hardwareKeycode
setEventKeyHardwareKeycode :: MonadIO m => EventKey -> Word16 -> m () Source #
Set the value of the “hardware_keycode
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #hardwareKeycode:=
value ]
isModifier
a flag that indicates if hardwareKeycode
is mapped to a
modifier. Since 2.10
getEventKeyIsModifier :: MonadIO m => EventKey -> m Word32 Source #
Get the value of the “is_modifier
” field.
When overloading is enabled, this is equivalent to
get
eventKey #isModifier
setEventKeyIsModifier :: MonadIO m => EventKey -> Word32 -> m () Source #
Set the value of the “is_modifier
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #isModifier:=
value ]
keyval
the key that was pressed or released. See the
gdk/gdkkeysyms.h
header file for a
complete list of GDK key codes.
getEventKeyKeyval :: MonadIO m => EventKey -> m Word32 Source #
Get the value of the “keyval
” field.
When overloading is enabled, this is equivalent to
get
eventKey #keyval
setEventKeyKeyval :: MonadIO m => EventKey -> Word32 -> m () Source #
Set the value of the “keyval
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #keyval:=
value ]
length
the length of string
.
getEventKeyLength :: MonadIO m => EventKey -> m Int32 Source #
Get the value of the “length
” field.
When overloading is enabled, this is equivalent to
get
eventKey #length
setEventKeyLength :: MonadIO m => EventKey -> Int32 -> m () Source #
Set the value of the “length
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #length:=
value ]
sendEvent
True
if the event was sent explicitly.
getEventKeySendEvent :: MonadIO m => EventKey -> m Int8 Source #
Get the value of the “send_event
” field.
When overloading is enabled, this is equivalent to
get
eventKey #sendEvent
setEventKeySendEvent :: MonadIO m => EventKey -> Int8 -> m () Source #
Set the value of the “send_event
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #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
.
getEventKeyState :: MonadIO m => EventKey -> m [ModifierType] Source #
Get the value of the “state
” field.
When overloading is enabled, this is equivalent to
get
eventKey #state
setEventKeyState :: MonadIO m => EventKey -> [ModifierType] -> m () Source #
Set the value of the “state
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #state:=
value ]
string
a string containing an approximation of the text that
would result from this keypress. The only correct way to handle text
input of text is using input methods (see GtkIMContext
), so this
field is deprecated and should never be used.
(unicodeToKeyval
provides a non-deprecated way of getting
an approximate translation for a key.) The string is encoded in the
encoding of the current locale (Note: this for backwards compatibility:
strings in GTK+ and GDK are typically in UTF-8.) and NUL-terminated.
In some cases, the translation of the key code will be a single
NUL byte, in which case looking at length
is necessary to distinguish
it from the an empty translation.
clearEventKeyString :: MonadIO m => EventKey -> m () Source #
Set the value of the “string
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#string
getEventKeyString :: MonadIO m => EventKey -> m (Maybe Text) Source #
Get the value of the “string
” field.
When overloading is enabled, this is equivalent to
get
eventKey #string
setEventKeyString :: MonadIO m => EventKey -> CString -> m () Source #
Set the value of the “string
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #string:=
value ]
time
the time of the event in milliseconds.
getEventKeyTime :: MonadIO m => EventKey -> m Word32 Source #
Get the value of the “time
” field.
When overloading is enabled, this is equivalent to
get
eventKey #time
setEventKeyTime :: MonadIO m => EventKey -> Word32 -> m () Source #
Set the value of the “time
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #time:=
value ]
type
the type of the event (EventTypeKeyPress
or EventTypeKeyRelease
).
getEventKeyType :: MonadIO m => EventKey -> m EventType Source #
Get the value of the “type
” field.
When overloading is enabled, this is equivalent to
get
eventKey #type
setEventKeyType :: MonadIO m => EventKey -> EventType -> m () Source #
Set the value of the “type
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #type:=
value ]
window
the window which received the event.
clearEventKeyWindow :: MonadIO m => EventKey -> m () Source #
Set the value of the “window
” field to Nothing
.
When overloading is enabled, this is equivalent to
clear
#window
getEventKeyWindow :: MonadIO m => EventKey -> m (Maybe Window) Source #
Get the value of the “window
” field.
When overloading is enabled, this is equivalent to
get
eventKey #window
setEventKeyWindow :: MonadIO m => EventKey -> Ptr Window -> m () Source #
Set the value of the “window
” field.
When overloading is enabled, this is equivalent to
set
eventKey [ #window:=
value ]