IBus.Keymap

g GObject.InitiallyUnowned GObject.InitiallyUnowned IBus.Object IBus.Object GObject.InitiallyUnowned->IBus.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned IBus.Keymap IBus.Keymap IBus.Object->IBus.Keymap

Subclasses:

None

Methods

Inherited:

IBus.Object (2), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get (name)

class

new (name)

lookup_keysym (keycode, state)

Virtual Methods

Inherited:

IBus.Object (1), GObject.Object (7)

Properties

None

Signals

Inherited:

IBus.Object (1), GObject.Object (1)

Fields

Inherited:

IBus.Object (1), GObject.Object (1)

Name

Type

Access

Description

keymap

[int]

r

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

name

str

r

The name of the keymap, such as ‘us’, ‘jp’.

parent

IBus.Object

r

Class Details

class IBus.Keymap(**kwargs)
Bases:

IBus.Object

Abstract:

No

Structure:

IBus.KeymapClass

An IBus.Keymap 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 IBus.Keymap instance and define the keyboard layout. Then IBus.Keymap.lookup_keysym() can convert scancodes back to the key symbols.

see_also: IBus.Component, IBus.EngineDesc

classmethod get(name)
Parameters:

name (str) – The keymap file to be loaded, such as ‘us’, ‘jp’.

Returns:

An IBus.Keymap associated with the giving name; or None if failed.

Return type:

IBus.Keymap

Get an IBus.Keymap associated with the giving name.

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

classmethod new(name)
Parameters:

name (str) – The keymap file to be loaded, such as ‘us’, ‘jp’.

Returns:

An IBus.Keymap associated with the giving name; or None if failed.

Return type:

IBus.Keymap

Get an IBus.Keymap associated with the giving name.

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

Deprecated since version ???: This function has been deprecated and should not be used in newly written code. Please use IBus.Keymap.get().

lookup_keysym(keycode, state)
Parameters:
  • keycode (int) – A scancode to be converted.

  • state (int) – Modifier flags(such as Ctrl, Shift).

Returns:

Corresponding keysym.

Return type:

int

Converts the scancode to keysym, given the keymap.