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

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)
 

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.

Parameters
bindinga key binding.
Returns
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.

Parameters
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
Returns
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.

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

Parameters
cKeyStringa shortkey.
Returns
TRUE if success.