GL Studio C++ Runtime API
events.h File Reference

The standard Mouse and keyboard events and event structures. More...

#include "component_base.h"
#include "display.h"
#include "gls_include.h"
#include "group.h"
#include "timer.h"
#include <string>

Go to the source code of this file.

Classes

class  DisplayEvent
 
class  LocationEvent
 
class  MouseEvent
 
class  KeyboardEvent
 
class  ObjectEvent
 
class  EventCompressor< T >
 

Namespaces

 disti
 

Macros

#define ON(event, subevent)   if( ( ev->eventType == ( event ) ) && ( ev->eventSubtype == ( subevent ) ) )
 
#define ON_MOUSE_UP(btnMask)   if( ( ev->eventType == EVENT_MOUSE ) && ( ev->eventSubtype == MOUSE_UP ) && ( (btnMask)&mev->buttonMask ) )
 
#define ON_MOUSE_DOWN(btnMask)   if( ( ev->eventType == EVENT_MOUSE ) && ( ev->eventSubtype == MOUSE_DOWN ) && ( (btnMask)&mev->buttonMask ) )
 
#define ON_MOUSE_DRAG(btnMask)   if( ( ev->eventType == EVENT_MOUSE ) && ( ev->eventSubtype == MOUSE_DRAG ) && ( (btnMask)&mev->buttonMask ) )
 
#define ON_KEY_DOWN(testKey)   if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, true, int( testKey ) ) )
 
#define ON_KEY_UP(testKey)   if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, true, int( testKey ) ) )
 
#define ON_KEY_DOWN_WITH_MODIFIER(testKey, modifierMask)   if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, true, int( testKey ), modifierMask ) )
 
#define ON_KEY_UP_WITH_MODIFIER(testKey, modifierMask)   if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, true, int( testKey ), modifierMask ) )
 
#define ON_SPECIAL_KEY_DOWN(keySym)   if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, false, int( keySym ) ) )
 
#define ON_SPECIAL_KEY_UP(keySym)   if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, false, int( keySym ) ) )
 
#define ON_SPECIAL_KEY_DOWN_WITH_MODIFIER(keySym, modifierMask)   if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, false, int( keySym ), modifierMask ) )
 
#define ON_SPECIAL_KEY_UP_WITH_MODIFIER(keySym, modifierMask)   if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, false, int( keySym ), modifierMask ) )
 
#define ON_ANY_KEY_DOWN()   if( ( ev->eventType == EVENT_KEYBOARD ) )
 
#define ON_ANY_KEY_UP()   if( ( ev->eventType == EVENT_KEYBOARD_UP ) )
 

Enumerations

enum  EventType_e {
  EVENT_MOUSE, EVENT_KEYBOARD, EVENT_TIMER, EVENT_OBJECT,
  EVENT_KEYBOARD_UP
}
 
enum  MouseEventType_e {
  MOUSE_DOWN, MOUSE_UP, MOUSE_MOVE, MOUSE_DRAG,
  MOUSE_LEAVE, MOUSE_ENTER, MOUSE_WHEEL_MINUS, MOUSE_WHEEL_PLUS,
  MOUSE_RECEIVE_MULTITOUCH, MOUSE_CANCEL
}
 
enum  MouseButtonType_e { MOUSE_LBUTTON = 1, MOUSE_MBUTTON = 2, MOUSE_RBUTTON = 4, MOUSE_BUTTON_ANY = 7 }
 
enum  SpecialKeyState_e
 

Functions

void EmitObjectEvent (DisplayObject *self, ObjectEvent *event)
 
void EmitObjectEvent (DisplayObject *self, const char *eventName, const char *eventData=NULL)
 
bool ObjectEventIs (DisplayEvent *event, const char *eventName, const char *eventData=NULL)
 
bool OnKeyEvent (KeyboardEvent *kev, bool alphaNumeric, int key, int modifierMask=0)
 

Detailed Description

The standard Mouse and keyboard events and event structures.

Copyright Information

Copyright (c) 2015 by The DiSTI Corporation.
11301 Corporate Blvd., Suite 100
Orlando, FL 32817
USA

All rights reserved.

This Software contains proprietary trade secrets of DiSTI and may not be reproduced, in whole or part, in any form, or by any means of electronic, mechanical, or otherwise, without the written permission of DiSTI. Said permission may be derived through the purchase of applicable DiSTI product licenses which detail the distribution rights of this content and any Derivative Works based on this or other copyrighted DiSTI Software.

NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND, AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.

LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT EXCEED FIVE DOLLARS (US$5.00).

The aforementioned terms and restrictions are governed by the laws of the State of Florida and the United States of America. Use, distribution, duplication, or disclosure by the U. S. Government is subject to "Restricted Rights" as set forth in DFARS 252.227-7014(c)(1)(ii).

Macro Definition Documentation

#define ON (   event,
  subevent 
)    if( ( ev->eventType == ( event ) ) && ( ev->eventSubtype == ( subevent ) ) )

Basic on event test, given the event and subevent enums.

#define ON_ANY_KEY_DOWN ( )    if( ( ev->eventType == EVENT_KEYBOARD ) )

On keyboard key down event test.

#define ON_ANY_KEY_UP ( )    if( ( ev->eventType == EVENT_KEYBOARD_UP ) )

On keyboard key up event test.

#define ON_KEY_DOWN (   testKey)    if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, true, int( testKey ) ) )

On keyboard key down event test, given the alpha numeric key to test.

#define ON_KEY_DOWN_WITH_MODIFIER (   testKey,
  modifierMask 
)    if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, true, int( testKey ), modifierMask ) )

On keyboard key down with modifiers event test, given the alpha numeric key and modifiers to test.

#define ON_KEY_UP (   testKey)    if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, true, int( testKey ) ) )

On keyboard key up event test, given the alpha numeric key to test.

#define ON_KEY_UP_WITH_MODIFIER (   testKey,
  modifierMask 
)    if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, true, int( testKey ), modifierMask ) )

On keyboard key up with modifiers event test, given the alpha numeric key and modifiers to test.

#define ON_MOUSE_DOWN (   btnMask)    if( ( ev->eventType == EVENT_MOUSE ) && ( ev->eventSubtype == MOUSE_DOWN ) && ( (btnMask)&mev->buttonMask ) )

On mouse button down event test, given the mouse button enum.

#define ON_MOUSE_DRAG (   btnMask)    if( ( ev->eventType == EVENT_MOUSE ) && ( ev->eventSubtype == MOUSE_DRAG ) && ( (btnMask)&mev->buttonMask ) )

On mouse button held during a drag event test, given the mouse button enum.

#define ON_MOUSE_UP (   btnMask)    if( ( ev->eventType == EVENT_MOUSE ) && ( ev->eventSubtype == MOUSE_UP ) && ( (btnMask)&mev->buttonMask ) )

On mouse button up event test, given the mouse button enum.

#define ON_SPECIAL_KEY_DOWN (   keySym)    if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, false, int( keySym ) ) )

On keyboard key down event test, given the special key to test.

#define ON_SPECIAL_KEY_DOWN_WITH_MODIFIER (   keySym,
  modifierMask 
)    if( ( ev->eventType == EVENT_KEYBOARD ) && OnKeyEvent( kev, false, int( keySym ), modifierMask ) )

On keyboard key down with modifiers event test, given the special key and modifiers to test.

#define ON_SPECIAL_KEY_UP (   keySym)    if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, false, int( keySym ) ) )

On keyboard key up event test, given the special key to test.

#define ON_SPECIAL_KEY_UP_WITH_MODIFIER (   keySym,
  modifierMask 
)    if( ( ev->eventType == EVENT_KEYBOARD_UP ) && OnKeyEvent( kev, false, int( keySym ), modifierMask ) )

On keyboard key up with modifiers event test, given the special key and modifiers to test.