Cairo-Dock 2.4.0~1
cairo-dock-keybinder.h File Reference

Typedefs

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

Functions

void cd_keybinder_stop (void)
 merge with init
gboolean cd_keybinder_bind (const char *keystring, CDBindkeyHandler handler, gpointer user_data)
 useless
void cd_keybinder_unbind (const char *keystring, CDBindkeyHandler handler)
gboolean cairo_dock_simulate_key_sequence (gchar *cKeyString)

Detailed Description

This class contains functions to easily bind a keyboard shortcut to an action. These shortcuts are defined globally in your session, that is to say they will be effective whatever window has the focus. Shortcuts are of the form <alt>F1 or <ctrl><shift>s.

You bind an action to a shortcut with cd_keybinder_bind, and unbind it with cd_keybinder_unbind.


Function Documentation

gboolean cd_keybinder_bind ( const char *  keystring,
CDBindkeyHandler  handler,
gpointer  user_data 
)

useless

Bind a shortcut to an action. Unbind it when you don't want it anymore, or when 'user_data' is freed.

Parameters:
keystringa shortcut.
handlercallback to register for this shortcut.
user_datadata passed to the callback.
Returns:
TRUE if success.
void cd_keybinder_unbind ( const char *  keystring,
CDBindkeyHandler  handler 
)

Unbind a shortcut to an action.

Parameters:
keystringa shortcut.
handlerthe callback that was registered for this shortcut.
gboolean cairo_dock_simulate_key_sequence ( gchar *  cKeyString)

Trigger the given shortcut. It will be as if the user effectively pressed the shortcut on its keyboard. It uses the 'XTest' X extension.

Parameters:
cKeyStringa shortcut.
Returns:
TRUE if success.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines