orx  1.10
Portable Game Engine
orxInput.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2019 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_KZ_CONFIG_SECTION "Input"
57 #define orxINPUT_KZ_CONFIG_SET_LIST "SetList"
58 #define orxINPUT_KZ_CONFIG_DEFAULT_THRESHOLD "DefaultThreshold"
59 #define orxINPUT_KZ_CONFIG_DEFAULT_MULTIPLIER "DefaultMultiplier"
60 #define orxINPUT_KZ_CONFIG_COMBINE_LIST "CombineList"
62 #define orxINPUT_KU32_BINDING_NUMBER 8
63 
64 #define orxINPUT_KZ_INTERNAL_SET_PREFIX "-="
65 
66 #define orxINPUT_KC_MODE_PREFIX_POSITIVE '+'
67 #define orxINPUT_KC_MODE_PREFIX_NEGATIVE '-'
68 
69 
72 typedef enum __orxINPUT_TYPE_t
73 {
80 
82 
83  orxINPUT_TYPE_NONE = orxENUM_NONE
84 
86 
89 typedef enum __orxINPUT_MODE_t
90 {
94 
96 
97  orxINPUT_MODE_NONE = orxENUM_NONE
98 
100 
103 typedef enum __orxINPUT_EVENT_t
104 {
108 
110 
111  orxINPUT_EVENT_NONE = orxENUM_NONE
112 
114 
117 typedef struct __orxINPUT_EVENT_PAYLOAD_t
118 {
119 const orxSTRING zSetName;
120  const orxSTRING zInputName;
124  orxFLOAT afValue[orxINPUT_KU32_BINDING_NUMBER];
127 
128 
131 extern orxDLLAPI void orxFASTCALL orxInput_Setup();
132 
136 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Init();
137 
140 extern orxDLLAPI void orxFASTCALL orxInput_Exit();
141 
142 
147 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Load(const orxSTRING _zFileName);
148 
153 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Save(const orxSTRING _zFileName);
154 
155 
160 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SelectSet(const orxSTRING _zSetName);
161 
165 extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetCurrentSet();
166 
167 
173 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_EnableSet(const orxSTRING _zSetName, orxBOOL _bEnable);
174 
179 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsSetEnabled(const orxSTRING _zSetName);
180 
181 
186 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsActive(const orxSTRING _zInputName);
187 
192 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenActivated(const orxSTRING _zInputName);
193 
198 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenDeactivated(const orxSTRING _zInputName);
199 
204 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasNewStatus(const orxSTRING _zInputName);
205 
210 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetValue(const orxSTRING _zInputName);
211 
217 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetValue(const orxSTRING _zInputName, orxFLOAT _fValue);
218 
224 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetPermanentValue(const orxSTRING _zInputName, orxFLOAT _fValue);
225 
230 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_ResetValue(const orxSTRING _zInputName);
231 
232 
237 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetThreshold(const orxSTRING _zInputName);
238 
244 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetThreshold(const orxSTRING _zInputName, orxFLOAT _fThreshold);
245 
250 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetMultiplier(const orxSTRING _zInputName);
251 
257 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetMultiplier(const orxSTRING _zInputName, orxFLOAT _fMultiplier);
258 
259 
265 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetCombineMode(const orxSTRING _zName, orxBOOL _bCombine);
266 
271 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsInCombineMode(const orxSTRING _zName);
272 
273 
282 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Bind(const orxSTRING _zName, orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxS32 _s32BindingIndex);
283 
289 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Unbind(const orxSTRING _zName, orxS32 _s32BindingIndex);
290 
297 extern orxDLLAPI orxU32 orxFASTCALL orxInput_GetBoundInputCount(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
298 
308 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBoundInput(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxU32 _u32InputIndex, const orxSTRING *_pzName, orxU32 *_pu32BindingIndex);
309 
318 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBinding(const orxSTRING _zName, orxU32 _u32BindingIndex, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
319 
327 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]);
328 
329 
336 extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBindingName(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
337 
345 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingType(const orxSTRING _zName, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
346 
353 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetActiveBinding(orxINPUT_TYPE *_peType, orxENUM *_peID, orxFLOAT *_pfValue);
354 
355 #endif /*_orxINPUT_H_*/
356 
orxDLLAPI orxU32 orxFASTCALL orxInput_GetBoundInputCount(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode)
orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenActivated(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SelectSet(const orxSTRING _zSetName)
orxINPUT_EVENT
Definition: orxInput.h:103
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Save(const orxSTRING _zFileName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_ResetValue(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Unbind(const orxSTRING _zName, orxS32 _s32BindingIndex)
orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetThreshold(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetPermanentValue(const orxSTRING _zInputName, orxFLOAT _fValue)
orxINPUT_MODE
Definition: orxInput.h:89
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_Bind(const orxSTRING _zName, orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxS32 _s32BindingIndex)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingType(const orxSTRING _zName, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode)
orxSTATUS
Definition: orxType.h:246
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:119
#define orxDLLAPI
Definition: orxDecl.h:381
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:120
orxDLLAPI void orxFASTCALL orxInput_Setup()
orxINPUT_TYPE
Definition: orxInput.h:72
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)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBoundInput(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxU32 _u32InputIndex, const orxSTRING *_pzName, orxU32 *_pu32BindingIndex)
#define orxINPUT_KU32_BINDING_NUMBER
Definition: orxInput.h:62
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Init()
orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenDeactivated(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetMultiplier(const orxSTRING _zInputName, orxFLOAT _fMultiplier)
orxDLLAPI orxBOOL orxFASTCALL orxInput_IsSetEnabled(const orxSTRING _zSetName)
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetCurrentSet()

Generated for orx by doxygen 1.8.11