orx  stable
Portable Game Engine
orxInput.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxINPUT_H_
44 #define _orxINPUT_H_
45 
46 
47 #include "orxInclude.h"
48 
49 #include "io/orxJoystick.h"
50 #include "io/orxKeyboard.h"
51 #include "io/orxMouse.h"
52 
53 
56 #define orxINPUT_KU32_BINDING_NUMBER 4
57 
58 #define orxINPUT_KZ_INTERNAL_SET_PREFIX "-="
59 
60 #define orxINPUT_KC_MODE_PREFIX_POSITIVE '+'
61 #define orxINPUT_KC_MODE_PREFIX_NEGATIVE '-'
62 
63 
66 typedef enum __orxINPUT_TYPE_t
67 {
74 
76 
77  orxINPUT_TYPE_NONE = orxENUM_NONE
78 
80 
83 typedef enum __orxINPUT_MODE_t
84 {
88 
90 
91  orxINPUT_MODE_NONE = orxENUM_NONE
92 
94 
97 typedef enum __orxINPUT_EVENT_t
98 {
102 
104 
105  orxINPUT_EVENT_NONE = orxENUM_NONE
106 
108 
111 typedef struct __orxINPUT_EVENT_PAYLOAD_t
112 {
113  const orxSTRING zSetName;
114  const orxSTRING zInputName;
118  orxFLOAT afValue[orxINPUT_KU32_BINDING_NUMBER];
121 
122 
125 extern orxDLLAPI void orxFASTCALL orxInput_Setup();
126 
130 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Init();
131 
134 extern orxDLLAPI void orxFASTCALL orxInput_Exit();
135 
136 
141 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Load(const orxSTRING _zFileName);
142 
147 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Save(const orxSTRING _zFileName);
148 
149 
154 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SelectSet(const orxSTRING _zSetName);
155 
159 extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetCurrentSet();
160 
161 
167 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_EnableSet(const orxSTRING _zSetName, orxBOOL _bEnable);
168 
173 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsSetEnabled(const orxSTRING _zSetName);
174 
175 
180 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsActive(const orxSTRING _zInputName);
181 
186 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasNewStatus(const orxSTRING _zInputName);
187 
192 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetValue(const orxSTRING _zInputName);
193 
199 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetValue(const orxSTRING _zInputName, orxFLOAT _fValue);
200 
206 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetPermanentValue(const orxSTRING _zInputName, orxFLOAT _fValue);
207 
212 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_ResetValue(const orxSTRING _zInputName);
213 
214 
219 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetThreshold(const orxSTRING _zInputName);
220 
226 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetThreshold(const orxSTRING _zInputName, orxFLOAT _fThreshold);
227 
232 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetMultiplier(const orxSTRING _zInputName);
233 
239 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetMultiplier(const orxSTRING _zInputName, orxFLOAT _fMultiplier);
240 
241 
247 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetCombineMode(const orxSTRING _zName, orxBOOL _bCombine);
248 
253 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsInCombineMode(const orxSTRING _zName);
254 
255 
263 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Bind(const orxSTRING _zName, orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
264 
271 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Unbind(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
272 
279 extern orxDLLAPI orxU32 orxFASTCALL orxInput_GetBoundInputCounter(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
280 
288 extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBoundInput(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxU32 _u32InputIndex);
289 
298 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBinding(const orxSTRING _zName, orxU32 _u32BindingIndex, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
299 
307 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingList(const orxSTRING _zName, orxINPUT_TYPE _aeTypeList[orxINPUT_KU32_BINDING_NUMBER], orxENUM _aeIDList[orxINPUT_KU32_BINDING_NUMBER], orxINPUT_MODE _aeModeList[orxINPUT_KU32_BINDING_NUMBER]);
308 
309 
316 extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBindingName(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
317 
325 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingType(const orxSTRING _zName, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
326 
333 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetActiveBinding(orxINPUT_TYPE *_peType, orxENUM *_peID, orxFLOAT *_pfValue);
334 
335 #endif /*_orxINPUT_H_*/
336 
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SelectSet(const orxSTRING _zSetName)
orxINPUT_EVENT
Definition: orxInput.h:97
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Save(const orxSTRING _zFileName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_ResetValue(const orxSTRING _zInputName)
orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetThreshold(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetPermanentValue(const orxSTRING _zInputName, orxFLOAT _fValue)
orxINPUT_MODE
Definition: orxInput.h:83
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBoundInput(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxU32 _u32InputIndex)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingList(const orxSTRING _zName, orxINPUT_TYPE _aeTypeList[orxINPUT_KU32_BINDING_NUMBER], orxENUM _aeIDList[orxINPUT_KU32_BINDING_NUMBER], orxINPUT_MODE _aeModeList[orxINPUT_KU32_BINDING_NUMBER])
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBindingName(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode)
orxDLLAPI orxBOOL orxFASTCALL orxInput_IsActive(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetActiveBinding(orxINPUT_TYPE *_peType, orxENUM *_peID, orxFLOAT *_pfValue)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetThreshold(const orxSTRING _zInputName, orxFLOAT _fThreshold)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingType(const orxSTRING _zName, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Bind(const orxSTRING _zName, orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode)
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetValue(const orxSTRING _zInputName, orxFLOAT _fValue)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetCombineMode(const orxSTRING _zName, orxBOOL _bCombine)
orxDLLAPI orxBOOL orxFASTCALL orxInput_IsInCombineMode(const orxSTRING _zName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Load(const orxSTRING _zFileName)
orxDLLAPI void orxFASTCALL orxInput_Exit()
const orxSTRING zSetName
Definition: orxInput.h:113
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetValue(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBinding(const orxSTRING _zName, orxU32 _u32BindingIndex, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode)
const orxSTRING zInputName
Definition: orxInput.h:114
orxDLLAPI void orxFASTCALL orxInput_Setup()
orxINPUT_TYPE
Definition: orxInput.h:66
orxDLLAPI orxBOOL orxFASTCALL orxInput_HasNewStatus(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_EnableSet(const orxSTRING _zSetName, orxBOOL _bEnable)
orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetMultiplier(const orxSTRING _zInputName)
#define orxINPUT_KU32_BINDING_NUMBER
Definition: orxInput.h:56
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Init()
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetMultiplier(const orxSTRING _zInputName, orxFLOAT _fMultiplier)
orxDLLAPI orxU32 orxFASTCALL orxInput_GetBoundInputCounter(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode)
orxDLLAPI orxBOOL orxFASTCALL orxInput_IsSetEnabled(const orxSTRING _zSetName)
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetCurrentSet()
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Unbind(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode)

Generated for orx by doxygen 1.5.6