Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MouseEventType Struct Reference

Information about mouse events. More...

#include <system.h>

List of all members.

Public Attributes

TPoint where
ulong eventFlags
ulong controlKeyState
uchar buttons


Detailed Description

Stores mouse events.

This structure holds the data that characterizes a mouse event: button number, whether double-clicked, and the coordinates of the point where the click was detected.

See also:
TEvent , TEventQueue

Definition at line 114 of file system.h.


Member Data Documentation

uchar MouseEventType::buttons
 

This variable reports the status of the mouse buttons when the event happened. It's a combination of the following constants:

 Flag          Value Meaning

 mbLeftButton  0x01  Set if left button was pressed
 mbRightButton 0x02  Set if right button was pressed
 

These constants are useful when examining the buttons data member. For example:

 if ((event.what == evMouseDown) && (event.buttons == mbLeftButton))
     doLeftButtonDownAction();
 

Note: you can swap left and right buttons by setting variable TEventQueue::mouseReverse to True. See the `demo' program for more information.

Definition at line 182 of file system.h.

ulong MouseEventType::controlKeyState
 

This bitmap variable stores the status of the control keys when the event happened. The following values define keyboard states, and can be used when examining the keyboard shift state:

 Flag          Value  Meaning

 kbRightShift  0x0001 Set if the Right Shift key is currently down
 kbLeftShift   0x0002 Set if the Left Shift key is currently down
 kbCtrlShift   0x0004 Set if the Ctrl key is currently down
 kbAltShift    0x0008 Set if the Alt key is currently down
 kbScrollState 0x0010 Set if the keyboard is in the Scroll Lock state
 kbNumState    0x0020 Set if the keyboard is in the Num Lock state
 kbCapsState   0x0040 Set if the keyboard is in the Caps Lock state
 kbInsState    0x0080 Set if the keyboard is in the Ins Lock state
 

Its value is 0 if none of these keys was pressed. Warning: this information is not reliable. Its value depends on your operating system and libraries (gpm, ncurses). Usually only a subset of these flags are detected. See file `system.cc' for details.

Definition at line 158 of file system.h.

ulong MouseEventType::eventFlags
 

Helps to specify the event.

This bitmap variable is set to meDoubleClick if a double-click event happened. If the mouse is simply moved its value is meMouseMoved. Otherwise its value is 0.

 Flag          Value Meaning

 meMouseMoved  0x01  Set if mouse is moved
 meDoubleClick 0x02  Set if a button was double clicked
 

Definition at line 134 of file system.h.

TPoint MouseEventType::where
 

This is the position where the event happened.

Definition at line 119 of file system.h.


The documentation for this struct was generated from the following file:
Generated at Sat Sep 22 20:19:29 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001