Modifier Flags

Modifier flags are sent during mouse and keyboard events and indicate which option keys are currently down. Defined in <XModifiers.h>, these constants are:

KKeyShift Shift key down
KKeyControl Control key down
KKeyCommand (Macintosh) Command (Apple) key is down
KKeyOption (Macintosh) Option key is down
KKeyMenu (Windows) Alt key is down.
KKeyMod1 (X) First modifier key is down
KKeyMod2 (X) Second modifier key is down
KKeyMod3 (X) Third modifier key is down
KKeyMod4 (X) Fourth modifier key is down
KKeyMod5 (X) Fifth modifier key is down
KKeyButton Mouse button is down (left button)
KKeyRButton Right mouse button down
KKeyMButton Middle mouse button down
KKeyButton2 (X) Second (right) mouse button down
KKeyButton3 (X) Third (middle) mouse button down
KKeyButton4 (X) Fourth mouse button down
KKeyButton5 (X) Fifth mouse button down
KDoubleClick (Mouse Event Only) Mouse double click.
KCapturedMouse (Mouse move, up only) Mouse was captured. (This is done by returning true from XGView::DoMouseDown.)
KSpecialKey (Key event only) A "special" (or non-ASCII) key was pressed.

The following constants are equal, and can be used to simplify porting applications.

KKeyCommand KKeyMod1
KKeyOption KKeyMenu, KKeyMod2
KKeyMenu KKeyOption, KKeyMod2
KKeyMod1 KKeyCommand
KKeyMod2 KKeyOption, KKeyMenu
KKeyRButton KKeyButton2
KKeyMButton KKeyButton3
KKeyButton2 KKeyRButton
KKeyButton3 KKeyMButton

These equivalencies simplfy porting applications by allowing someone to write code which accepts 'KKeyOption' keyboard presses, knowing that on Windows this will be the equivalent to the Alt key and to the second modifier key on X.