-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathkeyevent.h
More file actions
40 lines (30 loc) · 791 Bytes
/
Copy pathkeyevent.h
File metadata and controls
40 lines (30 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "global.h"
#include "spimpl.h"
namespace libscratchcpp
{
class KeyEventPrivate;
/*! \brief The KeyEvent class represents a Scratch key event. */
class LIBSCRATCHCPP_EXPORT KeyEvent
{
public:
enum class Type
{
Any,
Space,
Left,
Up,
Right,
Down,
Enter
};
KeyEvent(Type type = Type::Any);
KeyEvent(const std::string &name);
Type type() const;
const std::string &name() const;
friend bool operator==(const KeyEvent &ev1, const KeyEvent &ev2) { return ev1.name() == ev2.name(); }
private:
spimpl::impl_ptr<KeyEventPrivate> impl;
};
} // namespace libscratchcpp