nngn
Loading...
Searching...
No Matches
group.h
Go to the documentation of this file.
1#ifndef NNGN_INPUT_GROUP_H
2#define NNGN_INPUT_GROUP_H
3
4#include <unordered_map>
5
6#include "input.h"
7
8namespace nngn {
9
11 struct Info { int ref = {}; Input::Selector selector = {}; };
12 std::unordered_map<int, Info> m = {};
13 BindingGroup *m_next = nullptr;
14public:
15 BindingGroup *next(void) const { return this->m_next; }
17 Info for_key(int key) const;
18 Info for_event(int key, Input::Action action, Input::Modifier mods) const;
19 bool add(lua_State *L, int key, Input::Selector s);
20 bool remove(lua_State *L, int key);
21};
22
24 return std::exchange(this->m_next, p);
25}
26
27}
28
29#endif
Definition group.h:10
BindingGroup * m_next
Definition group.h:13
BindingGroup * next(void) const
Definition group.h:15
BindingGroup * set_next(BindingGroup *p)
Definition group.h:23
bool add(lua_State *L, int key, Input::Selector s)
Definition group.cpp:40
Info for_key(int key) const
Definition group.cpp:18
bool remove(lua_State *L, int key)
Definition group.cpp:56
Info for_event(int key, Input::Action action, Input::Modifier mods) const
Definition group.cpp:24
std::unordered_map< int, Info > m
Definition group.h:12
Definition audio.cpp:7
Definition group.h:11
Input::Selector selector
Definition group.h:11
int ref
Definition group.h:11
std::chrono::seconds s
Definition timing.cpp:6