DDraceNetwork Documentation
Loading...
Searching...
No Matches
key_binder.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef GAME_CLIENT_COMPONENTS_KEY_BINDER_H
4#define GAME_CLIENT_COMPONENTS_KEY_BINDER_H
5
8#include <game/client/ui.h>
9
10// component to fetch keypresses, override all other input
11class CKeyBinder : public CComponent
12{
13public:
14 int Sizeof() const override { return sizeof(*this); }
15 bool OnInput(const IInput::CEvent &Event) override;
16
18 {
19 public:
22 };
23 CKeyReaderResult DoKeyReader(CButtonContainer *pReaderButton, CButtonContainer *pClearButton, const CUIRect *pRect, const CBindSlot &CurrentBind, bool Activate);
24 bool IsActive() const;
25
26private:
28 bool m_TakeKey = false;
29 std::optional<CBindSlot> m_Key;
30};
31
32#endif
Definition binds.h:27
Definition ui.h:269
Definition component.h:165
Definition key_binder.h:18
CBindSlot m_Bind
Definition key_binder.h:20
bool m_Aborted
Definition key_binder.h:21
Definition key_binder.h:12
const CButtonContainer * m_pKeyReaderId
Definition key_binder.h:27
bool m_TakeKey
Definition key_binder.h:28
CKeyReaderResult DoKeyReader(CButtonContainer *pReaderButton, CButtonContainer *pClearButton, const CUIRect *pRect, const CBindSlot &CurrentBind, bool Activate)
Definition key_binder.cpp:34
std::optional< CBindSlot > m_Key
Definition key_binder.h:29
bool IsActive() const
Definition key_binder.cpp:96
bool OnInput(const IInput::CEvent &Event) override
Definition key_binder.cpp:14
int Sizeof() const override
Definition key_binder.h:14
Definition ui_rect.h:12
Definition input.h:22