Pad++ Reference Manual

Default Bindings


There are several default event bindings in Pad++ written in C++. In addition, the PadDraw sample application has many event bindings defined in Tcl that may be useful. There are two classes of default event bindings, navigation and widget bindings.

The navigation bindings allow panning on button 1, and zooming in and out on buttons 2 and 3, respectively. These bindings are very simple versions and a serious application may want to redefine them. They can be turned on and off the with -defaultEventHandlers widget configuration option. By default, they are off. The bindings are:

The widget bindings allow standard interaction with the user interface widgets. These bindings get created the first time a widget of each type is created. The event bindings are defined on tags of the name of the widget. Widgets are created with these tags by default, and so these bindings are defined by default. To disable these bindings, just remove the tag from the widget. The event bindings are defined in the "Run" mode, and so for them to be active, the Run modifier must be set. This can be done with:

.pad modifier set "Run"

For key bindings to work, the system focus must be set to the pad widget. You can do this with:

focus .pad

The default event bindings are:

Finally, the basic Text item has default event bindings that can be used to edit the text with emacs-style keys. To use these bindings, the text item must be made editable and given the tag "Text". In addition, the Run mode must be set, and the focus must be set to the Pad++ widget. An example creation of a text item that uses the handlers is:

.pad create text -text Hello -editable 1 -tags "Text" -anchor nw
.pad modifier set "Run"
focus .pad


Pad++ Reference Manual - 20 JUN 1997

Copyright Computer Science Department, The University of New Mexico

Web Accessibility