IBus.HotkeyProfile

g GObject.InitiallyUnowned GObject.InitiallyUnowned IBus.Object IBus.Object GObject.InitiallyUnowned->IBus.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned IBus.HotkeyProfile IBus.HotkeyProfile IBus.Serializable IBus.Serializable IBus.Object->IBus.Serializable IBus.Serializable->IBus.HotkeyProfile

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new ()

add_hotkey (keyval, modifiers, event)

add_hotkey_from_string (str, event)

filter_key_event (keyval, modifiers, prev_keyval, prev_modifiers, user_data)

lookup_hotkey (keyval, modifiers)

remove_hotkey (keyval, modifiers)

remove_hotkey_by_event (event)

Virtual Methods

Inherited:

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

do_trigger (event, *user_data)

Properties

None

Signals

Inherited:

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

Name

Short Description

trigger

Emitted when a hotkey is pressed and the hotkey is in profile.

Fields

Inherited:

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

Name

Type

Access

Description

parent

IBus.Serializable

r

Class Details

class IBus.HotkeyProfile(**kwargs)
Bases:

IBus.Serializable

Abstract:

No

Structure:

IBus.HotkeyProfileClass

An opaque data type representing an IBus.HotkeyProfile.

classmethod new()
Returns:

A newly allocated IBus.HotkeyProfile.

Return type:

IBus.HotkeyProfile

Creates a new IBus.HotkeyProfile.

add_hotkey(keyval, modifiers, event)
Parameters:
  • keyval (int) – Keycode of the hotkey.

  • modifiers (int) – Modifiers of the hotkey.

  • event (int) – The event to be associated.

Returns:

Always True.

Return type:

bool

Adds a hotkey and its associated event to an IBus.HotkeyProfile.

add_hotkey_from_string(str, event)
Parameters:
  • str (str) – Key in string representation. ‘+’ is the separator.

  • event (int) – The event to be associated.

Returns:

False if str contains invalid symbol; True otherwise.

Return type:

bool

Adds a hotkey and its associated event to an IBus.HotkeyProfile. The hotkey is in string format, such like

Control+Shift+A.

filter_key_event(keyval, modifiers, prev_keyval, prev_modifiers, user_data)
Parameters:
  • keyval (int) – Keycode of the hotkey.

  • modifiers (int) – Modifiers of the hotkey.

  • prev_keyval (int) – Keycode of the hotkey.

  • prev_modifiers (int) – Modifiers of the hotkey.

  • user_data (object or None) – user data for signal “trigger”.

Returns:

0 if releasing a hotkey and the hotkey is not in the profile; an associated event otherwise.

See also: ::trigger

Return type:

int

Emits a ::trigger signal when a hotkey is in a profile.

lookup_hotkey(keyval, modifiers)
Parameters:
  • keyval (int) – Keycode of the hotkey.

  • modifiers (int) – Modifiers of the hotkey.

Returns:

The event associated to the hotkey or 0 if the hotkey is not in the profile.

Return type:

int

remove_hotkey(keyval, modifiers)
Parameters:
  • keyval (int) – Keycode of the hotkey.

  • modifiers (int) – Modifiers of the hotkey.

Returns:

False if the key is not in self, True otherwise.

Return type:

bool

Removes the hotkey for an IBus.HotkeyProfile.

remove_hotkey_by_event(event)
Parameters:

event (int) – The associated event.

Returns:

False if no such event in self, True otherwise.

Return type:

bool

Removes the hotkey for an IBus.HotkeyProfile by event.

do_trigger(event, *user_data) virtual
Parameters:

Signal Details

IBus.HotkeyProfile.signals.trigger(hotkey_profile, event, user_data)
Signal Name:

trigger

Flags:

RUN_LAST, DETAILED

Parameters:
  • hotkey_profile (IBus.HotkeyProfile) – The object which received the signal

  • event (int) – An event in GQuark.

  • user_data (object or None) – User data for callback.

Emitted when a hotkey is pressed and the hotkey is in profile. Implement the member function trigger() in extended class to receive this signal.

The last parameter, user_data is not actually a valid parameter. It is displayed because of GtkDoc bug.