Cairo-Dock
3.4.0
|
Macros | |
#define | gldi_shortkey_could_grab(binding) |
Typedefs | |
typedef void(* | CDBindkeyHandler )(const gchar *keystring, gpointer user_data) |
Definition of a callback, called when a shortcut is pressed by the user. | |
Functions | |
GldiShortkey * | gldi_shortkey_new (const gchar *keystring, const gchar *cDemander, const gchar *cDescription, const gchar *cIconFilePath, const gchar *cConfFilePath, const gchar *cGroupName, const gchar *cKeyName, CDBindkeyHandler handler, gpointer user_data) |
gboolean | gldi_shortkey_rebind (GldiShortkey *binding, const gchar *cNewKeyString, const gchar *cNewDescription) |
gboolean | cairo_dock_trigger_shortkey (const gchar *cKeyString) |
This class defines the Shortkeys, which are objects that bind a keyboard shortcut to an action. The keyboard shortcut is defined globally on the desktop, that is to say they will be effective whatever window has the focus. Keyboard shortcuts are of the form <alt>F1 or <ctrl><shift>s.
Use gldi_shortkey_new to create a new shortkey, and simply unref it with gldi_object_unref to unbind the keyboard shortcut. To update a binding (whenever the shortcut or the description change, or just to re-grab it), use gldi_shortkey_rebind.
#define gldi_shortkey_could_grab | ( | binding | ) |
Says if the shortkey of a key binding could be grabbed.
binding | a key binding. |
GldiShortkey* gldi_shortkey_new | ( | const gchar * | keystring, |
const gchar * | cDemander, | ||
const gchar * | cDescription, | ||
const gchar * | cIconFilePath, | ||
const gchar * | cConfFilePath, | ||
const gchar * | cGroupName, | ||
const gchar * | cKeyName, | ||
CDBindkeyHandler | handler, | ||
gpointer | user_data | ||
) |
Create a new shortkey, that binds an action to a shortkey. Unref it when you don't want it anymore, or when 'user_data' is freed.
keystring | a shortcut. |
cDemander | the actor making the demand |
cDescription | a short description of the action |
cIconFilePath | an icon that represents the demander |
cConfFilePath | conf file where the shortkey stored |
cGroupName | group name where it's stored in the conf file |
cKeyName | key name where it's stored in the conf file |
handler | function called when the shortkey is pressed by the user |
user_data | data passed to the callback |
gboolean gldi_shortkey_rebind | ( | GldiShortkey * | binding, |
const gchar * | cNewKeyString, | ||
const gchar * | cNewDescription | ||
) |
Rebind a shortkey to a new one. If the shortkey is the same, don't re-bind it.
binding | a key binding. |
cNewKeyString | the new shortkey |
cNewDescription | the new description, or NULL to keep the current one. |
gboolean cairo_dock_trigger_shortkey | ( | const gchar * | cKeyString | ) |
Trigger a given shortkey. It will be as if the user effectively pressed the shortkey on its keyboard. It uses the 'XTest' X extension.
cKeyString | a shortkey. |