| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /*
- * Copyright 2011-2014 Branimir Karadzic. All rights reserved.
- * License: http://www.opensource.org/licenses/BSD-2-Clause
- */
- #ifndef ENTRY_H_HEADER_GUARD
- #define ENTRY_H_HEADER_GUARD
- #include "dbg.h"
- #include <bx/bx.h>
- namespace entry
- {
- struct MouseButton
- {
- enum Enum
- {
- None,
- Left,
- Middle,
- Right,
- Count
- };
- };
- struct Modifier
- {
- enum Enum
- {
- None = 0,
- LeftAlt = 0x01,
- RightAlt = 0x02,
- LeftCtrl = 0x04,
- RightCtrl = 0x08,
- LeftShift = 0x10,
- RightShift = 0x20,
- LeftMeta = 0x40,
- RightMeta = 0x80,
- };
- };
- struct Key
- {
- enum Enum
- {
- None = 0,
- Esc,
- Return,
- Tab,
- Space,
- Backspace,
- Up,
- Down,
- Left,
- Right,
- PageUp,
- PageDown,
- Home,
- End,
- Print,
- Plus,
- Minus,
- F1,
- F2,
- F3,
- F4,
- F5,
- F6,
- F7,
- F8,
- F9,
- F10,
- F11,
- F12,
- NumPad0,
- NumPad1,
- NumPad2,
- NumPad3,
- NumPad4,
- NumPad5,
- NumPad6,
- NumPad7,
- NumPad8,
- NumPad9,
- Key0,
- Key1,
- Key2,
- Key3,
- Key4,
- Key5,
- Key6,
- Key7,
- Key8,
- Key9,
- KeyA,
- KeyB,
- KeyC,
- KeyD,
- KeyE,
- KeyF,
- KeyG,
- KeyH,
- KeyI,
- KeyJ,
- KeyK,
- KeyL,
- KeyM,
- KeyN,
- KeyO,
- KeyP,
- KeyQ,
- KeyR,
- KeyS,
- KeyT,
- KeyU,
- KeyV,
- KeyW,
- KeyX,
- KeyY,
- KeyZ,
- };
- };
- struct MouseState
- {
- MouseState()
- : m_mx(0)
- , m_my(0)
- {
- for (uint32_t ii = 0; ii < entry::MouseButton::Count; ++ii)
- {
- m_buttons[ii] = entry::MouseButton::None;
- }
- }
- uint32_t m_mx;
- uint32_t m_my;
- uint8_t m_buttons[entry::MouseButton::Count];
- };
- bool processEvents(uint32_t& _width, uint32_t& _height, uint32_t& _debug, uint32_t& _reset, MouseState* _mouse = NULL);
- } // namespace entry
- #endif // ENTRY_H_HEADER_GUARD
|