IBusKeymap

IBusKeymap — Keyboard mapping handling.

Stability Level

Stable, unless otherwise indicated

Synopsis

typedef             KEYMAP;
                    IBusKeymap;
IBusKeymap *        ibus_keymap_new                     (const gchar *name);
guint               ibus_keymap_lookup_keysym           (IBusKeymap *keymap,
                                                         guint16 keycode,
                                                         guint32 state);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----IBusObject
               +----IBusKeymap

Description

An IBusKeymap defines the mapping between keyboard scancodes and keyboard symbols such as numbers, alphabets, and punctuation marks.

Some input methods assume certain keyboard layout (such as Chewing and Wubi requires an US-QWERTY layout), and expect key symbols to be arranged in that order. These input methods should new an IBusKeymap instance and define the keyboard layout. Then ibus_keymap_lookup_keysym() can convert scancodes back to the key symbols.

Details

KEYMAP

typedef guint KEYMAP[256][7];

Data structure for storing keymap. keymap[.][i] i: 0 - without modifer 1 - shift 2 - caplock 3 - shift caplock 4 - altgr 5 - shift altgr 6 - numlock


IBusKeymap

typedef struct {
    gchar *name;
    KEYMAP keymap;
} IBusKeymap;

A keymap object in IBus.

gchar *name;

The name of the keymap, such as 'us', 'jp'.

KEYMAP keymap;

Keymap table. IME developers normally don have to touch this.

ibus_keymap_new ()

IBusKeymap *        ibus_keymap_new                     (const gchar *name);

New an IBusKeymap.

This function loads the keymap file specified in name in the IBUS_DATA_DIR/keymaps directory.

name :

The keymap file to be loaded, such as 'us', 'jp'.

Returns :

A newly allocated IBusKeymap; or NULL if failed.

ibus_keymap_lookup_keysym ()

guint               ibus_keymap_lookup_keysym           (IBusKeymap *keymap,
                                                         guint16 keycode,
                                                         guint32 state);

Convert the scancode to keysym, given the keymap.

keymap :

An IBusKeymap.

keycode :

A scancode to be converted.

state :

Modifier flags(such as Ctrl, Shift).

Returns :

Corresponding keysym.

See Also

#IBusComponent, IBusEngineDesc