ManaPlus
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 
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 
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),
65  mask(mask0)
66  { }
67 
69 
70  const std::string args;
71  ChatTab *const tab;
73  const int mask;
74 };
75 
76 #endif // EVENTS_INPUTEVENT_H
InputAction ::T InputActionT
Definition: inputaction.h:717
std::map< int, KeysVector > KeyToActionMap
Definition: inputevent.h:40
KeysVector::const_iterator KeysVectorCIter
Definition: inputevent.h:38
KeyTimeMap::iterator KeyTimeMapIter
Definition: inputevent.h:47
KeyToActionMap::iterator KeyToActionMapIter
Definition: inputevent.h:41
std::map< int, InputActionT > KeyToIdMap
Definition: inputevent.h:43
std::vector< InputActionT > KeysVector
Definition: inputevent.h:34
std::map< int, int > KeyTimeMap
Definition: inputevent.h:46
KeysVector::iterator KeysVectorIter
Definition: inputevent.h:37
KeyToIdMap::iterator KeyToIdMapIter
Definition: inputevent.h:44
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
#define nullptr
Definition: localconsts.h:45
const int mask
Definition: inputevent.h:73
ChatTab *const tab
Definition: inputevent.h:71
InputEvent(const std::string &args0, ChatTab *const tab0, const int mask0)
Definition: inputevent.h:59
const std::string args
Definition: inputevent.h:70
const InputActionT action
Definition: inputevent.h:72
InputEvent(const InputActionT action0, const int mask0)
Definition: inputevent.h:51