Header for hotkey.c.
More...
#include <gdk/gdkx.h>
Go to the source code of this file.
Header for hotkey.c.
Header for hotkey.c.
Definition in file hotkey.h.
◆ Hotkey
◆ hotkey_accel_to_code()
void hotkey_accel_to_code |
( |
const gchar * |
accel, |
|
|
gint * |
code, |
|
|
GdkModifierType * |
mods |
|
) |
| |
Translate a Gtk Accelerator string to a key code and mods.
- Parameters
-
accel | the accelerator string to parse. |
code | the key code returned after parsing. |
mods | the key modifiers after parsing. |
Definition at line 230 of file hotkey.c.
◆ hotkey_code_to_accel()
gchar* hotkey_code_to_accel |
( |
guint |
code, |
|
|
GdkModifierType |
mods |
|
) |
| |
Translate a key into a Gtk Accelerator string.
- Parameters
-
code | the key code to process. |
mods | the key modifiers to process. |
- Returns
- the accelerator string, must be freed.
Definition at line 208 of file hotkey.c.
◆ hotkey_free()
void hotkey_free |
( |
Hotkey * |
hotkey | ) |
|
Ungrab a key and free any resources.
- Parameters
-
Definition at line 160 of file hotkey.c.
◆ hotkey_grab()
gboolean hotkey_grab |
( |
Hotkey * |
hotkey | ) |
|
Grab a key manually. Should be paired with a hotkey_ungrab() call.
- Parameters
-
- Returns
- TRUE on success, FALSE on error.
Definition at line 92 of file hotkey.c.
◆ hotkey_matches()
gboolean hotkey_matches |
( |
Hotkey * |
hotkey, |
|
|
guint |
code, |
|
|
GdkModifierType |
mods |
|
) |
| |
Checks if the keycode we got (minus modifiers like numlock/capslock) matches the hotkey. Thus numlock + o will match o.
- Parameters
-
hotkey | a Hotkey instance. |
code | the key code to compare against. |
mods | the key modifiers to compare against. |
- Returns
- TRUE if there is a match, FALSE otherwise.
Definition at line 138 of file hotkey.c.
◆ hotkey_new()
Hotkey* hotkey_new |
( |
guint |
code, |
|
|
GdkModifierType |
mods |
|
) |
| |
Creates a new hotkey and grab it.
- Parameters
-
code | the key's code. |
mods | the key's modifiers. |
- Returns
- the newly created Hotkey instance.
Definition at line 179 of file hotkey.c.
◆ hotkey_ungrab()
void hotkey_ungrab |
( |
Hotkey * |
hotkey | ) |
|
Ungrab a key manually. Should be paired with a hotkey_grab() call.
- Parameters
-
- Returns
- TRUE on success, FALSE on error.
Definition at line 68 of file hotkey.c.