Chapter 4. Event Definitions

Table of Contents

Standard Event Definitions
System Events
gre.init
gre.quit
gre.redraw
Pointer events
gre.press
gre.release
gre.touch
gre.inbound
gre.outbound
Keyboard Events
gre.keydown
gre.keyup
Screen Manager Events
gre.screenshow.pre
gre.screenshow.post
gre.screenhide.pre
gre.screenhide.post
Focus Events
gre.gotfocus
gre.lostfocus
Table Events
gre.table.viewport
gre.cell.gotfocus
gre.cell.lostfocus
Plugin Event Definitions
gre.gesture.up
gre.gesture.down
gre.gesture.left
gre.gesture.right
gre.screendump.complete
timer.[name] Timer Events
gre.animate.complete.[name] Animation Events

Standard Event Definitions

Storyboard supports a list of standard events.  These events are all prefixed with gre. and can be used by your application.  

System Events

gre.init

The system has been initialized and is ready.  This is the first event set in the system.

Data:

        No data payload

gre.quit

The system is being shutdown.

Data:

        No data payload

gre.redraw

An area of the screen has been damaged (visible data has changed). A redraw event may not cause actual screen drawing if the control which has changed is hidden or offscreen.

Data:

int32_t   x
int32_t   y
int32_t   width
int32_t   height
                    

If the values are all 0 then the entire screen has been damaged

Pointer events

The following events are generated in response to a device such as a mouse or a touchscreen.  These events are targeted at specific controls based upon the controls location and sensitivity.

gre.press

A mouse/touchscreen has been pressed.

Data

uint32_t    button
uint32_t    timestamp
int16_t     subtype
int16_t     x
int16_t     y
int16_t     z
                    

Where:

button
GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
GR_EVENT_BTN_MIDDLE - 0x0002
GR_EVENT_BTN_RIGHT - 0x0004
timestamp

This is an event timestamp in milliseconds since application start

subtype
GR_EVENT_RELEASE_IN
GR_EVENT_RELEASE_OUT
z

This parameter is dependent on the availability of z- co-ordinate information

gre.release

A mouse/trouchscreen has been released.

Data

uint32_t    button
uint32_t    timestamp
int16_t     subtype
int16_t     x
int16_t     y
int16_t     z
                    

Where:

button
GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
GR_EVENT_BTN_MIDDLE - 0x0002
GR_EVENT_BTN_RIGHT - 0x0004
timestamp

This is an event timestamp in milliseconds since application start

subtype
GR_EVENT_RELEASE_IN
GR_EVENT_RELEASE_OUT
z

This parameter is dependent on the availability of z- co-ordinate information

gre.touch

If a mouse/touchscreen presses and then releases on the same control then a touch event will be generated.  This is useful for activating button style elements.  If the release is found to intersect a different control then a touch event is not generated.

[Note]Note

This event is synthetically generated by the framework based on incoming gre.press and gre.release events. Event redirectors should generally not include this event in their list of redirection events.

Data

uint32_t    button
uint32_t    timestamp
int16_t     subtype
int16_t     x
int16_t     y
int16_t     z
                    

Where:

button
GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
GR_EVENT_BTN_MIDDLE - 0x0002
GR_EVENT_BTN_RIGHT - 0x0004
timestamp

This is an event timestamp in milliseconds since application start

subtype
GR_EVENT_RELEASE_IN
GR_EVENT_RELEASE_OUT
z

This parameter is dependent on the availability of z- co-ordinate information

gre.inbound

A mouse/touchscreen has entered a control (if dragging a pointer or finger).  This event is generated once the coordinates enter a control boundary.  If mouse motion events are disabled in the render manager then this event will not be generated.

Data

uint32_t    button
uint32_t    timestamp
int16_t     subtype
int16_t     x
int16_t     y
int16_t     z
                    

Where:

button
GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
GR_EVENT_BTN_MIDDLE - 0x0002
GR_EVENT_BTN_RIGHT - 0x0004
timestamp

This is an event timestamp in milliseconds since application start

subtype
GR_EVENT_RELEASE_IN
GR_EVENT_RELEASE_OUT
z

This parameter is dependent on the availability of z- co-ordinate information

gre.outbound

A mouse/touchscreen has left a control (if dragging a pointer or finger).  This event is generated once the coordinates leave a control boundary.  If mouse motion events are disabled in the render manager then this event will not be generated.

Data

uint32_t    button
uint32_t    timestamp
int16_t     subtype
int16_t     x
int16_t     y
int16_t     z
                    

Where:

button
GR_EVENT_BTN_LEFT - 0x0001: if this is a touchscreen then the button is always left
GR_EVENT_BTN_MIDDLE - 0x0002
GR_EVENT_BTN_RIGHT - 0x0004
timestamp

This is an event timestamp in milliseconds since application start

subtype
GR_EVENT_RELEASE_IN
GR_EVENT_RELEASE_OUT
z

This parameter is dependent on the availability of z- co-ordinate information

Keyboard Events

The following events are generated if a keyboard is present and supported by the render manager.

gre.keydown

A key is in the pressed state

Data

uint32_t    code
uint32_t    modifiers
                    

Where:

code

This is the UTF-8 key value

modifiers

A set of modifiers applied to the key

GR_EVENT_KEYMOD_ALT
GR_EVENT_KEYMOD_CTRL
GR_EVENT_KEYMOD_SHIFT

gre.keyup

A key which was previously pressed has been released

Data

uint32_t    code
uint32_t    modifiers
                    

Where:

code

This is the UTF-8 key value

modifiers

A set of modifiers applied to the key

GR_EVENT_KEYMOD_ALT
GR_EVENT_KEYMOD_CTRL
GR_EVENT_KEYMOD_SHIFT

Screen Manager Events

The following events are generated by the Screen Manager during screen transitions.  These events are generated in the following order:

gre.screenshow.pre delivered to target (end) screen
gre.screenhide.pre delivered to source (start) screen
gre.screenshow.post delivered to target (end) screen
gre.screenhide.post delivered to source (start) screen

gre.screenshow.pre

A screen is being shown.  This event is triggered before the screen is shown and signifies that a transition may be starting

Data:

char *name

The name of the screen which is being shown

gre.screenshow.post

A screen has been shown.  This event is triggered after the screen is shown and signifies that a transition has ended.

Data:

char *name

The name of the screen which has been shown

gre.screenhide.pre

A screen is being hidden.  This event is triggered before the screen is hidden and signifies that a transition may be starting.

Data:

char *name

The name of the screen which is being hidden

gre.screenhide.post

A screen has been hidden.  This event is triggered after the screen is hidden and signifies that a transition has ended.

Data:

char *name

The name of the screen which has been hidden

Focus Events

The following events are generated on a change of control focus.  If there is no focusable control on the current screen then these events will not be generated.  These events are targeted at the currently or last focused control.  When focus shifts from one control to another the lost focus event is sent first followed by the got focus event.

gre.gotfocus

A control has received focus, delivered to the control that received the focus.

No data payload.

gre.lostfocus

A control has lost focus, delivered to the control that has lost the focus.

No data payload.

Table Events

The following events are generated by a Table control.  If no table control is present then these events will not be generated.

gre.table.viewport

A table has been resized via the table resize action.  This event notifies the system of the new table size and visible area.

Data:

uint32_t    top_row    
uint32_t    left_col    
uint32_t    bot_row;    
uint32_t    right_col;  
char        *table
                    

Where:

top_row

The top row that is visible

left_col

The left column that is visible

bot_row

The bottom row that is visible

right_col

The right column that is visible

table

The name of the table whose viewport changed to cause this event

gre.cell.gotfocus

A table cell has received focus and is the currently active cell. This is delivered to the control template with the cell focus information.

Data:

uint32_t    row;    
uint32_t    col;    
char *table
                    

Where:

row

The row that received focus

col

The column that received focus

table

The name of the table where the cell focus changed

gre.cell.lostfocus

A table cell has lost focus and is no longer the active cell. This is delivered to the control template with the cell focus information

Data:

uint32_t    row;    
uint32_t    col;    
char *table
                    

Where:

row

The row that received focus

col

The column that received focus

table

The name of the table where the cell focus changed