diff options
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/input.h')
-rw-r--r-- | 3rdparty/bgfx/examples/common/entry/input.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/input.h b/3rdparty/bgfx/examples/common/entry/input.h index 66c60c091e2..281267d338b 100644 --- a/3rdparty/bgfx/examples/common/entry/input.h +++ b/3rdparty/bgfx/examples/common/entry/input.h @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * Copyright 2010-2017 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ @@ -12,6 +12,24 @@ typedef void (*InputBindingFn)(const void* _userData); struct InputBinding { + void set(entry::Key::Enum _key, uint8_t _modifiers, uint8_t _flags, InputBindingFn _fn, const void* _userData = NULL) + { + m_key = _key; + m_modifiers = _modifiers; + m_flags = _flags; + m_fn = _fn; + m_userData = _userData; + } + + void end() + { + m_key = entry::Key::None; + m_modifiers = entry::Modifier::None; + m_flags = 0; + m_fn = NULL; + m_userData = NULL; + } + entry::Key::Enum m_key; uint8_t m_modifiers; uint8_t m_flags; |