Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide

Customizing Button Bindings

A button binding associates a mouse button operation and possible keyboard modifier key with a window manager function. Button bindings apply to all workspaces.

The desktop default button bindings are defined in the Workspace Manager configuration file in a button binding set named DtButtonBindings:

Buttons DtButtonBindings
 {
   ...
 }

Button Binding Syntax

The syntax for button bindings is:

Buttons ButtonBindingSetName
 {
     [modifier]<button_nameMouse_action>   context  function  [argument]
     [modifier]<button_nameMouse_action>   context  function  [argument]

where:

button_name--Btn1--Left mouse button Btn2--Middle button (3-button mouse) or both buttons (2-button mouse) Btn3--Right button Btn4--Buttons 1 and 2 together on a 3-button mouse Btn5--Buttons 2 and 3 together on a 3-button mouse

modifier--Ctrl, Shift, Alt, Lock

mouse_action--Down--Holding down a mouse; button Up--Releasing a mouse button; Click--Pressing and releasing a mouse button; Click2--Double-clicking a mouse button; Drag--Dragging the mouse while holding down the mouse button

context--indicates where the pointer must be for the binding to be effective. If necessary, separate multiple contents with the "|" character.

root--The workspace window; window--Client window or window frame; frame--Window frame, excluding the contents; icon--Icon; title--Title bar; app--Client window (excluding the frame)

function--one of the window manager functions. Refer to the dtwmrc(4) man page for a list of valid functions.

argument--any window manager function arguments that are required. Refer to the dtwmrc(4) man page for details.

For example, the following line causes the menu described in DtRootMenu to be displayed when mouse button 3 is pressed while the pointer is in the workspace window (but not within client windows).

<Btn3Down>      root     f.menu     DtRootMenu

Note -

For complete information on button binding syntax, see the dtwmrc(4) man page.


To Add a Button Binding

  1. Open the appropriate file for editing:

  2. Add the button binding to the DtButtonBindings definition.

    Do not bind the same button to different functions for the click and press operations, and do not bind more than one function to the same button and context.

  3. Choose Restart Workspace Manager from the Workspace menu.

To Create a New Button Binding Set

  1. Open the appropriate file for editing:

  2. Create the new button binding set. See "Button Binding Syntax".

  3. Set the buttonBindings resource to the new name:

    	Dtwm*buttonBindings: ButtonBindingsSetName 
    
  4. Choose Restart Workspace Manager from the Workspace menu.


    Note -

    The new button bindings replace your existing button bindings. Copy any button bindings you want to keep from DtButtonBindings.