Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Related Functions | List of all members
bmptk::graphics::event Class Reference

something that the users caused to happen on the screen More...

#include <graphics.h>

Public Member Functions

 event (const vector p, const event_type e)
 creates an event from its location and type
 
vector location_get () const
 get the location
 
event_type event_type_get () const
 get the event_type
 

Related Functions

(Note that these are not member functions.)

enum  event_type {
  event_none, event_exit, event_down, event_touch,
  event_up, event_click
}
 types of events More...
 
const char * event_type_name (const event_type e)
 
std::ostream & operator<< (std::ostream &s, const event_type &e)
 
std::ostream & operator<< (std::ostream &s, const event &e)
 prints an event
 

Detailed Description

something that the users caused to happen on the screen

An event is a something that happens at a specific position on a screen. A typical event would be the user touching the screen with a stylus, or clicking on a certain position with a mouse.

When a user

the following events will be generated in this order:

The last event (click) will only be generated if the down and the touch ocurred within rapid succession.

Definition at line 550 of file graphics.h.

Friends And Related Function Documentation

enum event_type
related

types of events

This type represents an action the user performs on the screen, using a mouse or stylus (on a touch screen).

Enumerator:
event_none 

nothing happened

This event type is used when an event object is required, but nothing happened. The location has no meaning.

event_exit 

user requests application exit

This event type is used when the user requests the (sub)application to terminate. The location has no meaning.

event_down 

user lands on the screen

This event type is used when the user lands on the screen: the mouse button is pressed down, or the stylus first contacts the screen. The location indicates where this happened.

event_touch 

user moves while touching the screen

This event type is used when the user touches a new pixel, either because the cursor or stylus first touched down on the screen, or because the the mouse cursor or stylus was down and moved to a different pixel. The location indicates the (new) pixel.

This event type would typically be used by a freehand paint application.

event_up 

user takes off from the screen

This event type is used when the user has landed on the screen but now takes off (releases the mouse button, or moves the stylus from the screen). The location is the last location where the user was on the screen.

event_click 

user clicks on the screen

This event type is used when the user clicks on the screen, which is the same as down and up in rapid succession. The down and up events will also be generated. The location is the location of the up event.

Definition at line 461 of file graphics.h.

const char * event_type_name ( const event_type  e)
related

return the name of an event_type

std::ostream & operator<< ( std::ostream &  s,
const event_type e 
)
related

prints the name of an event_type

std::ostream & operator<< ( std::ostream &  s,
const event e 
)
related

prints an event

Example:

touch:(47,120)


The documentation for this class was generated from the following file: