Event Specifications

As you may have noticed, an event specification is usually a list composed of an event type keyword and some other qualifiers. In fact, an event type keyword alone is also a valid event specification. The exact syntax for event specifications is fairly complex. A sophisticated programmer can even define his own event specification syntax. All of this is completely spelled out in the CLUE specification. But for now, you can get an idea of what an event specification is by looking at the following examples.

 
:enter-notify         ; Matches any :enter-notify event

(:motion-notify       ; Matches a :motion-notify event..
  :button-1)          ; ...if :button-1 is down.

(:button-press        ; Matches a :button-press...
  :button-1           ; ...if it's :button-1...
  :shift)             ; ...and the shift key is down.

(:button-release      ; Matches a :button-release...
  :button-3           ; ...if it's :button-3...
  (:shift :control)   ; ...and the shift,control keys are down...
  :all)               ; ...and all other modifiers are up.

(:key-press           ; Matches a :key-press...
  :any                ; ...for any key...
  (:control :hyper))  ; ...when the control,hyper keys are down.

(:button-press        ; Matches a :button-press...
  :button-3           ; ...if it's :button-3...
  :double-click)      ; ...and it's a double-click.

\framebox[5.5in]{
\hspace*{\fill}
{\bf Note}
\hspace*{\fill}
\parbox[t]{4.5in}{A...
...hem in the X Protocol
Specification and the CLUE specification.}\hspace*{\fill}}