2013-08-08 00:45:56 -04:00
|
|
|
/*
|
2014-02-11 01:07:04 -05:00
|
|
|
* Copyright 2010-2014 Branimir Karadzic. All rights reserved.
|
2013-08-08 00:45:56 -04:00
|
|
|
* License: http://www.opensource.org/licenses/BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2013-11-14 22:10:10 -05:00
|
|
|
#ifndef INPUT_H_HEADER_GUARD
|
|
|
|
#define INPUT_H_HEADER_GUARD
|
2013-08-08 00:45:56 -04:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "entry.h"
|
|
|
|
|
|
|
|
typedef void (*InputBindingFn)(const void* _userData);
|
|
|
|
|
|
|
|
struct InputBinding
|
|
|
|
{
|
|
|
|
entry::Key::Enum m_key;
|
|
|
|
uint8_t m_modifiers;
|
|
|
|
uint8_t m_flags;
|
|
|
|
InputBindingFn m_fn;
|
|
|
|
const void* m_userData;
|
|
|
|
};
|
|
|
|
|
2013-08-08 01:50:01 -04:00
|
|
|
#define INPUT_BINDING_END { entry::Key::None, entry::Modifier::None, 0, NULL, NULL }
|
2013-08-08 00:45:56 -04:00
|
|
|
|
|
|
|
///
|
|
|
|
void inputAddBindings(const char* _name, const InputBinding* _bindings);
|
|
|
|
|
|
|
|
///
|
|
|
|
void inputRemoveBindings(const char* _name);
|
|
|
|
|
|
|
|
///
|
|
|
|
void inputProcess();
|
|
|
|
|
|
|
|
///
|
|
|
|
void inputSetKeyState(entry::Key::Enum _key, uint8_t _modifiers, bool _down);
|
|
|
|
|
|
|
|
///
|
|
|
|
void inputSetMouseResolution(uint16_t _width, uint16_t _height);
|
|
|
|
|
|
|
|
///
|
2014-08-06 00:13:50 -04:00
|
|
|
void inputSetMousePos(int32_t _mx, int32_t _my, int32_t _mz);
|
2013-08-08 00:45:56 -04:00
|
|
|
|
|
|
|
///
|
|
|
|
void inputSetMouseButtonState(entry::MouseButton::Enum _button, uint8_t _state);
|
|
|
|
|
|
|
|
///
|
|
|
|
void inputSetMouseLock(bool _lock);
|
|
|
|
|
|
|
|
///
|
2014-08-06 00:13:50 -04:00
|
|
|
void inputGetMouse(float _mouse[3]);
|
2013-08-08 00:45:56 -04:00
|
|
|
|
|
|
|
///
|
|
|
|
bool inputIsMouseLocked();
|
|
|
|
|
2013-11-14 22:10:10 -05:00
|
|
|
#endif // INPUT_H_HEADER_GUARD
|