libscratchcpp
A library for C++ based Scratch project players
Toggle main menu visibility
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
8
namespace
libscratchcpp
9
{
10
11
class
KeyEventPrivate;
12
14
class
LIBSCRATCHCPP_EXPORT
KeyEvent
15
{
16
public
:
17
enum class
Type
18
{
19
Any,
20
Space,
21
Left,
22
Up,
23
Right,
24
Down,
25
Enter
26
};
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
libscratchcpp::KeyEvent
The KeyEvent class represents a Scratch key event.
Definition
keyevent.h:15
libscratchcpp::KeyEvent::KeyEvent
KeyEvent(Type type=Type::Any)
Definition
keyevent.cpp:11
libscratchcpp::KeyEvent::name
const std::string & name() const
Definition
keyevent.cpp:29
libscratchcpp::KeyEvent::operator==
friend bool operator==(const KeyEvent &ev1, const KeyEvent &ev2)
Definition
keyevent.h:34
libscratchcpp::KeyEvent::Type
Type
Definition
keyevent.h:18
global.h
LIBSCRATCHCPP_EXPORT
#define LIBSCRATCHCPP_EXPORT
Definition
global.h:17
libscratchcpp
The main namespace of the library.
Definition
asset.h:10
include
scratchcpp
keyevent.h
Generated by
1.17.0