IBusKeymap

IBusKeymap — Keyboard mapping handling.

Stability Level

Stable, unless otherwise indicated

Synopsis

struct              IBusKeymap;
struct              IBusKeymapClass;
IBusKeymap *        ibus_keymap_new                     (const gchar *name);
IBusKeymap *        ibus_keymap_get                     (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.

see_also: IBusComponent, IBusEngineDesc

Details

struct IBusKeymap

struct IBusKeymap {
    gchar *name;
    guint keymap[256][7];
};

A keymap object in IBus.

gchar *name;

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

guint keymap[256][7];

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

struct IBusKeymapClass

struct IBusKeymapClass {
    IBusObjectClass parent;
};


ibus_keymap_new ()

IBusKeymap *        ibus_keymap_new                     (const gchar *name);

Warning

ibus_keymap_new is deprecated and should not be used in newly-written code. This function has been deprecated and should not be used in newly written code. Please use ibus_keymap_get().

Get an IBusKeymap associated with the giving name.

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 :

An IBusKeymap associated with the giving name; or NULL if failed.

ibus_keymap_get ()

IBusKeymap *        ibus_keymap_get                     (const gchar *name);

Get an IBusKeymap associated with the giving name.

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 :

An IBusKeymap associated with the giving name; 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.