SkkKeyEvent

SkkKeyEvent — Object representing a key event.

Functions

Properties

guint code Read
SkkModifierType modifiers Read / Write
gchar * name Read

Types and Values

Object Hierarchy

    GFlags
    ╰── SkkModifierType
    GObject
    ╰── SkkKeyEvent

Description

Functions

skk_key_event_copy ()

SkkKeyEvent *
skk_key_event_copy (SkkKeyEvent *self);

Create a copy of the key event.

Parameters

self

the SkkKeyEvent instance

 

Returns

a new KeyEvent


skk_key_event_to_string ()

gchar *
skk_key_event_to_string (SkkKeyEvent *self);

Convert the KeyEvent to string.

Parameters

self

the SkkKeyEvent instance

 

Returns

a string representing the KeyEvent


skk_key_event_base_equal ()

gboolean
skk_key_event_base_equal (SkkKeyEvent *self,
                          SkkKeyEvent *key);

Compare two key events ignoring modifiers.

Parameters

self

the SkkKeyEvent instance

 

key

 .

a KeyEvent

.

[in]

Returns

`true` if those base components are equal, `false` otherwise


skk_key_event_new ()

SkkKeyEvent *
skk_key_event_new (const gchar *name,
                   gunichar code,
                   SkkModifierType modifiers);

Create a key event.

Parameters

name

 .

a key name

.

[in][allow-none]

code

 .

a character code

.

[in]

modifiers

 .

state of modifier keys

.

[in]

Returns

a new KeyEvent


skk_key_event_new_from_string ()

SkkKeyEvent *
skk_key_event_new_from_string (const gchar *key,
                               GError **error);

Create a key event from string.

Parameters

key

 .

a string representation of a key event

.

[in]

error

location to store the error occurring, or NULL to ignore.

[error-domains SkkKeyEventFormatError]

Returns

a new KeyEvent


skk_key_event_new_from_x_keysym ()

SkkKeyEvent *
skk_key_event_new_from_x_keysym (guint keyval,
                                 SkkModifierType modifiers,
                                 GError **error);

Create a key event from an X keysym and modifiers.

Parameters

keyval

 .

an X keysym

.

[in]

modifiers

 .

modifier mask

.

[in]

error

location to store the error occurring, or NULL to ignore.

[error-domains SkkKeyEventFormatError]

Returns

a new KeyEvent


skk_key_event_get_name ()

const gchar *
skk_key_event_get_name (SkkKeyEvent *self);

Get and return the current value of the "name" property.

The base name of the KeyEvent.

This is exclusive to "code".

Parameters

self

the SkkKeyEvent instance to query

 

Returns

the value of the "name" property


skk_key_event_get_code ()

gunichar
skk_key_event_get_code (SkkKeyEvent *self);

Get and return the current value of the "code" property.

The base code of the KeyEvent.

This is exclusive to "name".

Parameters

self

the SkkKeyEvent instance to query

 

Returns

the value of the "code" property


skk_key_event_get_modifiers ()

SkkModifierType
skk_key_event_get_modifiers (SkkKeyEvent *self);

Get and return the current value of the "modifiers" property.

Modifier mask.

Parameters

self

the SkkKeyEvent instance to query

 

Returns

the value of the "modifiers" property


skk_key_event_set_modifiers ()

void
skk_key_event_set_modifiers (SkkKeyEvent *self,
                             SkkModifierType value);

Set the value of the "modifiers" property to value .

Modifier mask.

Parameters

self

the SkkKeyEvent instance to modify

 

value

the new value of the "modifiers" property

 

Types and Values

SKK_TYPE_KEY_EVENT

#define SKK_TYPE_KEY_EVENT (skk_key_event_get_type ())

The type for SkkKeyEvent.


struct SkkKeyEvent

struct SkkKeyEvent;

Object representing a key event.


struct SkkKeyEventClass

struct SkkKeyEventClass {
	GObjectClass parent_class;
};

The class structure for SKK_TYPE_KEY_EVENT. All the fields in this structure are private and should never be accessed directly.

Members


enum SkkModifierType

A set of bit-flags to indicate the state of modifier keys.

Members

SKK_MODIFIER_TYPE_NONE

   

SKK_MODIFIER_TYPE_SHIFT_MASK

   

SKK_MODIFIER_TYPE_LOCK_MASK

   

SKK_MODIFIER_TYPE_CONTROL_MASK

   

SKK_MODIFIER_TYPE_MOD1_MASK

   

SKK_MODIFIER_TYPE_MOD2_MASK

   

SKK_MODIFIER_TYPE_MOD3_MASK

   

SKK_MODIFIER_TYPE_MOD4_MASK

   

SKK_MODIFIER_TYPE_MOD5_MASK

   

SKK_MODIFIER_TYPE_LSHIFT_MASK

   

SKK_MODIFIER_TYPE_RSHIFT_MASK

   

SKK_MODIFIER_TYPE_USLEEP_MASK

   

SKK_MODIFIER_TYPE_SUPER_MASK

   

SKK_MODIFIER_TYPE_HYPER_MASK

   

SKK_MODIFIER_TYPE_META_MASK

   

SKK_MODIFIER_TYPE_RELEASE_MASK

   

enum SkkKeyEventFormatError

Members

SKK_KEY_EVENT_FORMAT_ERROR_PARSE_FAILED

   

SKK_KEY_EVENT_FORMAT_ERROR_KEYSYM_NOT_FOUND

   

Property Details

The “code” property

  “code”                     guint

The base code of the KeyEvent.

This is exclusive to "name".

Owner: SkkKeyEvent

Flags: Read

Default value: 0


The “modifiers” property

  “modifiers”                SkkModifierType

Modifier mask.

Owner: SkkKeyEvent

Flags: Read / Write


The “name” property

  “name”                     gchar *

The base name of the KeyEvent.

This is exclusive to "code".

Owner: SkkKeyEvent

Flags: Read

Default value: NULL