unbindCDKObject

Langue: en

Autres versions - même langue

Version: 289920 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

cdk_binding - Curses Development Kit Character Binding Capabilities.

SYNOPSIS

cc [ flag ... ] file ... -lcdk [ library ... ]

 #include <cdk/cdk.h>
 
void bindCDKObject (
EObjectType cdkType, void *object, chtype key, BINDFN function, void *data);
int checkCDKObjectBind (
EObjectType cdkType, void *object, chtype key);
void cleanCDKObjectBindings (
EObjectType cdkType, void *object);
bool isCDKObjectBind (
EObjectType cdkType, void *object, chtype key);
void unbindCDKObject (
EObjectType cdkType, void *object, chtype key);
int getcCDKObject (
CDKOBJS *object);
int getchCDKObject (
CDKOBJS *object, boolean *functionKey);

 

DESCRIPTION


 
 Cdk has the ability to create user definable key bindings.
 This ability makes
 Cdk more dynamic and usable for a wide variety of tasks.
 The following section
 outlines the binding functions, their use, and their purpose.
 
bindCDKObject
creates a key binding between a specific Cdk widget (object) given key (key). The parameter cdkType is of type EObjectType which is one of the following values.

 
EObjectType_Value


vALPHALIST
Alphalist Widget
vBUTTON
Button Widget
cdk_button (3)                              
vBUTTONBOX
Buttonbox Widget
cdk_buttonbox (3)                              
vCALENDAR
Calendar Widget
cdk_calendar (3)                              
vDIALOG
Dialog Widget
cdk_dialog (3)                              
vDSCALE
DoubleFloat Widget
cdk_dscale (3)                              
vENTRY
Entry Widget
cdk_entry (3)                              
vFSCALE
Floating Scale Widget
cdk_fscale (3)                              
vFSELECT
File Selector Widget
cdk_fselect (3)                              
vFSLIDER
Floating Slider Widget
cdk_fslider (3)                              
vGRAPH
Graph Widget
cdk_graph (3)                              
vHISTOGRAM
Histogram Widget
cdk_histogram (3)                              
vITEMLIST
Item List Widget
cdk_itemlist (3)                              
vLABEL
Label Widget
cdk_label (3)                              
vMARQUEE
Marquee Widget
cdk_marquee (3)                              
vMATRIX
Matrix Widget
cdk_matrix (3)                              
vMENTRY
Multiple Line Entry Widget
cdk_mentry (3)                              
vMENU
Menu Widget
cdk_menu (3)                              
vRADIO
Radio List Widget
cdk_radio (3)                              
vSCALE
Integer Scale Widget
cdk_scale (3)                              
vSCROLL
Scrolling List Widget
cdk_scroll (3)                              
vSELECTION
Selection List Widget
cdk_selection (3)                              
vSLIDER
Slider Widget
cdk_slider (3)                              
vSWINDOW
Scrolling Window Widget
cdk_swindow (3)                              
vTEMPLATE
Template Entry Widget
cdk_template (3)                              
vUSCALE
Unsigned Scale Widget
cdk_uscale (3)                              
vUSLIDER
Unsigned Slider Widget
cdk_uslider (3)                              
vVIEWER
Viewer Widget
cdk_viewer (3)                              



 
 
The parameter function is the callback function. The parameter data points to data passed to the callback function. The parameter key is the key hit which triggered this callback.

 
 
checkCDKObjectBind
check to see if a binding for the given key exists. If it does, Cdk runs the associated command and returns its value, normally TRUE. If no binding exists, return FALSE.
The widgets which accept input, e.g., via "inject" methods, use this to check if the injected character is bound to a function. If that returns TRUE, the widget may update its exitType value: if earlyExit value is set (not equal to vNEVER_ACTIVATED), the widget sets exitType to that value.
cleanCDKObjectBindings
removes all user defined key bindings from the given widget.
isCDKObjectBind
check to see if a binding for the given key exists. If it does return TRUE. If no binding exists, return FALSE.
unbindCDKObject
removes a specific binding to an object. The parameter are the same as for bindCDKObject.
getcCDKObject
reads a keycode from the given widget. This is depcrecated: use getchCDKObject.
getchCDKObject
reads a keycode from the given widget. It sets a flag to indicate if the result is a function key. If the keycode has been bound to the special function getcCDKBind, then it will be translated to the value which was given for the binding data. Otherwise, a few special cases are performed:
Key Result


CTRL-A KEY_HOME
CTRL-B KEY_LEFT
CTRL-E KEY_END
CTRL-F KEY_RIGHT
CTRL-N tab
CTRL-P KEY_BTAB
DEL KEY_DC
backspace KEY_BACKSPACE
carriage return KEY_ENTER
newline KEY_ENTER

 
All of the widgets use getchCDKObject internally for consistency.

EXAMPLE


 
 To help demonstrate how to use the key bindings I will demonstrate a simple
 dialog box widget with help for each button.
 The following code segment creates
 a dialog box and a callback function named dialogHelpCB.
 

 

 
 
________________________________________

 
 

SEE ALSO


 
 cdk(3),
 
 cdk_display(3),
 
 cdk_screen(3)