ge211  2021.5.1
A student game engine
ge211::events Namespace Reference

Detailed Description

Types for representing mouse and keyboard events.

Classes

class  Key
 Represents a key on the keyboard. More...
 

Enumerations

enum  Mouse_button { left, middle, right }
 A representation of a mouse button. More...
 

Functions

std::ostreamoperator<< (std::ostream &, Mouse_button)
 Prints a Mouse_button on a std::ostream. More...
 
bool operator== (Key a, Key b)
 Equality for keys.
 
bool operator!= (Key a, Key b)
 Disequality for keys.
 
std::ostreamoperator<< (std::ostream &, Key::Type)
 Prints a Key::Type on a std::ostream. More...
 
std::ostreamoperator<< (std::ostream &, Key)
 Prints a Key on a std::ostream. More...
 

Enumeration Type Documentation

◆ Mouse_button

enum Mouse_button
strong

A representation of a mouse button.

This is used by Abstract_game::on_mouse_down(Mouse_button, Posn<int>) and Abstract_game::on_mouse_up(Mouse_button, Posn<int>) to specify which mouse button was depressed or released.

Enumerator
left 

The primary mouse button. This is an ordinary click.

middle 

The tertiary mouse button.

If you don’t have an actual mouse with three buttons then you might not have this.

right 

The secondary mouse button.

On a track pad you might do this with control-click or a two-finger tap.

Definition at line 19 of file ge211_event.hxx.

Function Documentation

◆ operator<<() [1/3]

std::ostream & operator<< ( std::ostream os,
Key  key 
)

Prints a Key on a std::ostream.

This function prints a representation suitable for debugging, but probably not suitable for end users.

Definition at line 124 of file ge211_event.cxx.

◆ operator<<() [2/3]

std::ostream & operator<< ( std::ostream os,
Key::Type  type 
)

Prints a Key::Type on a std::ostream.

This function prints a representation suitable for debugging, but probably not suitable for end users.

Definition at line 118 of file ge211_event.cxx.

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream os,
Mouse_button  button 
)

Prints a Mouse_button on a std::ostream.

This function prints a representation suitable for debugging, but probably not suitable for end users.

Definition at line 85 of file ge211_event.cxx.