Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-keybinder.h File Reference


#define gldi_shortkey_could_grab(binding)


typedef void(* CDBindkeyHandler )(const gchar *keystring, gpointer user_data)
 Definition of a callback, called when a shortcut is pressed by the user.


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)

Detailed Description

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.

Macro Definition Documentation

#define gldi_shortkey_could_grab (   binding)

Says if the shortkey of a key binding could be grabbed.

bindinga key binding.
TRUE iif the shortkey has been successfuly grabbed by the key binding.

Function Documentation

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.

keystringa shortcut.
cDemanderthe actor making the demand
cDescriptiona short description of the action
cIconFilePathan icon that represents the demander
cConfFilePathconf file where the shortkey stored
cGroupNamegroup name where it's stored in the conf file
cKeyNamekey name where it's stored in the conf file
handlerfunction called when the shortkey is pressed by the user
user_datadata passed to the callback
the shortkey, already bound.
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.

bindinga key binding.
cNewKeyStringthe new shortkey
cNewDescriptionthe new description, or NULL to keep the current one.
TRUE on success
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.

cKeyStringa shortkey.
TRUE if success.