Gorgon Game Engine
Modifier Class Reference

This class represents a modifier key. These keys can be. More...

Public Types

enum  Type {
  None, Shift, Ctrl, Alt,
  Meta, ShiftCtrl, ShiftAlt, CtrlAlt,
  ShiftCtrlAlt, ModMask, ModCompare
}
 A type to represent modifier keys. More...
 

Public Member Functions

 Modifier (Type key=None)
 Constructs a new modifier from the given modifier key. More...
 
void Add (Key key)
 Adds the given keyboard key to modifiers. More...
 
void Add (Type key)
 Adds the given modifier key. More...
 
bool IsModified () const
 Checks if this modifier really modifies the key state so that no printable characters can be formed. More...
 
 operator bool () const
 Check modifier. More...
 
bool operator! () const
 Check modifier. More...
 
Modifier operator& (const Modifier &r) const
 And operator. More...
 
Modifieroperator&= (const Modifier &r)
 And assignment. More...
 
Modifieroperator= (const Modifier &)=default
 Assignment operator. More...
 
Modifier operator| (const Modifier &r) const
 Or operator. More...
 
Modifieroperator|= (const Modifier &r)
 Or assignment. More...
 
void Remove (Key key)
 Removes the given keyboard key from modifiers. More...
 
void Remove (Type key)
 Removes the modifier key. More...
 

Public Attributes

Type Key
 The modifier key. More...
 

Detailed Description

This class represents a modifier key. These keys can be.

Member Enumeration Documentation

◆ Type

enum Type

A type to represent modifier keys.

Enumerator
None 

No modifier is pressed.

Shift 

Only shift modifier is pressed.

Ctrl 

Only control modifier is pressed.

Alt 

Only alt modifier is pressed.

Meta 

Only meta/super/window modifier is pressed.

ShiftCtrl 

Shift and control.

ShiftAlt 

Shift and alt.

CtrlAlt 

Control and alt.

ShiftCtrlAlt 

Shift control alt together.

ModMask 

Modifier mask to check if the key is modified.

ModCompare 

Modifier mask to check if the key is modified.

Constructor & Destructor Documentation

◆ Modifier()

Modifier ( Type  key = None)

Constructs a new modifier from the given modifier key.

Member Function Documentation

◆ Add() [1/2]

◆ Add() [2/2]

void Add ( Type  key)

Adds the given modifier key.

◆ IsModified()

bool IsModified ( ) const

Checks if this modifier really modifies the key state so that no printable characters can be formed.

References Modifier::Shift.

◆ operator bool()

operator bool ( ) const
explicit

Check modifier.

References Modifier::None.

◆ operator!()

bool operator! ( ) const

Check modifier.

References Modifier::None.

◆ operator&()

Modifier operator& ( const Modifier r) const

And operator.

References Modifier::Key.

◆ operator&=()

Modifier& operator&= ( const Modifier r)

And assignment.

References Modifier::Key.

◆ operator=()

Modifier& operator= ( const Modifier )
default

Assignment operator.

◆ operator|()

Modifier operator| ( const Modifier r) const

Or operator.

References Modifier::Key.

◆ operator|=()

Modifier& operator|= ( const Modifier r)

Or assignment.

References Modifier::Key.

◆ Remove() [1/2]

◆ Remove() [2/2]

void Remove ( Type  key)

Removes the modifier key.

Member Data Documentation

◆ Key

The modifier key.


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