ManaPlus
src
events
inputevent.h
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2012-2019 The ManaPlus Developers
4
* Copyright (C) 2019-2021 Andrei Karas
5
*
6
* This file is part of The ManaPlus Client.
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#ifndef EVENTS_INPUTEVENT_H
23
#define EVENTS_INPUTEVENT_H
24
25
#include "
enums/input/inputaction.h
"
26
27
#include "
utils/vector.h
"
28
29
#include <map>
30
#include <string>
31
32
#include "
localconsts.h
"
33
34
class
ChatTab
;
35
36
typedef
STD_VECTOR<InputActionT>
KeysVector
;
37
typedef
KeysVector::iterator
KeysVectorIter
;
38
typedef
KeysVector::const_iterator
KeysVectorCIter
;
39
40
typedef
std::map<int, KeysVector>
KeyToActionMap
;
41
typedef
KeyToActionMap::iterator
KeyToActionMapIter
;
42
43
typedef
std::map<int, InputActionT>
KeyToIdMap
;
44
typedef
KeyToIdMap::iterator
KeyToIdMapIter
;
45
46
typedef
std::map<int, int>
KeyTimeMap
;
47
typedef
KeyTimeMap::iterator
KeyTimeMapIter
;
48
49
struct
InputEvent
final
50
{
51
InputEvent
(
const
InputActionT
action0,
52
const
int
mask0) :
53
args
(),
54
tab
(
nullptr
),
55
action
(action0),
56
mask
(mask0)
57
{ }
58
59
InputEvent
(
const
std::string &args0,
60
ChatTab
*
const
tab0,
61
const
int
mask0) :
62
args
(args0),
63
tab
(tab0),
64
action
(
InputAction
::
NO_VALUE
),
65
mask
(mask0)
66
{ }
67
68
A_DELETE_COPY
(
InputEvent
)
69
70
const
std
::
string
args
;
71
ChatTab
*const
tab
;
72
const
InputActionT
action
;
73
const
int
mask
;
74
};
75
76
#endif
// EVENTS_INPUTEVENT_H
ChatTab
Definition:
chattab.h:63
inputaction.h
InputActionT
InputAction ::T InputActionT
Definition:
inputaction.h:717
KeyToActionMap
std::map< int, KeysVector > KeyToActionMap
Definition:
inputevent.h:40
KeysVectorCIter
KeysVector::const_iterator KeysVectorCIter
Definition:
inputevent.h:38
KeyTimeMapIter
KeyTimeMap::iterator KeyTimeMapIter
Definition:
inputevent.h:47
KeyToActionMapIter
KeyToActionMap::iterator KeyToActionMapIter
Definition:
inputevent.h:41
KeyToIdMap
std::map< int, InputActionT > KeyToIdMap
Definition:
inputevent.h:43
KeysVector
std::vector< InputActionT > KeysVector
Definition:
inputevent.h:34
KeyTimeMap
std::map< int, int > KeyTimeMap
Definition:
inputevent.h:46
KeysVectorIter
KeysVector::iterator KeysVectorIter
Definition:
inputevent.h:37
KeyToIdMapIter
KeyToIdMap::iterator KeyToIdMapIter
Definition:
inputevent.h:44
localconsts.h
final
#define final
Definition:
localconsts.h:46
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
nullptr
#define nullptr
Definition:
localconsts.h:45
InputAction
Definition:
inputaction.h:41
InputAction::NO_VALUE
@ NO_VALUE
Definition:
inputaction.h:44
std
Definition:
mseprimitives.h:398
InputEvent
Definition:
inputevent.h:50
InputEvent::mask
const int mask
Definition:
inputevent.h:73
InputEvent::tab
ChatTab *const tab
Definition:
inputevent.h:71
InputEvent::InputEvent
InputEvent(const std::string &args0, ChatTab *const tab0, const int mask0)
Definition:
inputevent.h:59
InputEvent::args
const std::string args
Definition:
inputevent.h:70
InputEvent::action
const InputActionT action
Definition:
inputevent.h:72
InputEvent::InputEvent
InputEvent(const InputActionT action0, const int mask0)
Definition:
inputevent.h:51
vector.h
Generated on Wed Mar 17 2021 19:19:05 for ManaPlus by
1.9.1