libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
keyevent.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include "global.h"
6#include "spimpl.h"
7
8namespace libscratchcpp
9{
10
11class KeyEventPrivate;
12
15{
16 public:
27
28 KeyEvent(Type type = Type::Any);
29 KeyEvent(const std::string &name);
30
31 Type type() const;
32 const std::string &name() const;
33
34 friend bool operator==(const KeyEvent &ev1, const KeyEvent &ev2) { return ev1.name() == ev2.name(); }
35
36 private:
37 spimpl::impl_ptr<KeyEventPrivate> impl;
38};
39
40} // namespace libscratchcpp
The KeyEvent class represents a Scratch key event.
Definition keyevent.h:15
KeyEvent(Type type=Type::Any)
Definition keyevent.cpp:11
const std::string & name() const
Definition keyevent.cpp:29
friend bool operator==(const KeyEvent &ev1, const KeyEvent &ev2)
Definition keyevent.h:34
Type
Definition keyevent.h:18
@ Down
Definition keyevent.h:24
@ Up
Definition keyevent.h:22
@ Right
Definition keyevent.h:23
@ Left
Definition keyevent.h:21
@ Space
Definition keyevent.h:20
@ Any
Definition keyevent.h:19
@ Enter
Definition keyevent.h:25
#define LIBSCRATCHCPP_EXPORT
Definition global.h:17
The main namespace of the library.
Definition asset.h:10