libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
libscratchcpp::KeyEvent Class Reference

The KeyEvent class represents a Scratch key event. More...

#include <scratchcpp/keyevent.h>

Public Types

enum class  Type {
  Any , Space , Left , Up ,
  Right , Down , Enter
}
 

Public Member Functions

 KeyEvent (Type type=Type::Any)
 
 KeyEvent (const std::string &name)
 
Type type () const
 
const std::string & name () const
 

Friends

bool operator== (const KeyEvent &ev1, const KeyEvent &ev2)
 

Detailed Description

The KeyEvent class represents a Scratch key event.

Member Enumeration Documentation

◆ Type

enum class libscratchcpp::KeyEvent::Type
strong
Enumerator
Any 
Space 
Left 
Up 
Right 
Down 
Enter 

Constructor & Destructor Documentation

◆ KeyEvent() [1/2]

libscratchcpp::KeyEvent::KeyEvent ( Type type = Type::Any)

Constructs KeyEvent.

◆ KeyEvent() [2/2]

libscratchcpp::KeyEvent::KeyEvent ( const std::string & name)

Constructs KeyEvent from a key name.

Member Function Documentation

◆ name()

const std::string & libscratchcpp::KeyEvent::name ( ) const

Returns the name of the key.

◆ type()

KeyEvent::Type libscratchcpp::KeyEvent::type ( ) const

Returns the type of the key.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const KeyEvent & ev1,
const KeyEvent & ev2 )
friend

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