orx  1.11
Portable Game Engine
orxInput.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2020 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 #define orxINPUT_GET_FLAG(TYPE) ((orxU32)(1U << (orxU32)(TYPE)))
70 #define orxINPUT_KU32_FLAG_TYPE_NONE 0x00000000
71 #define orxINPUT_KU32_MASK_TYPE_ALL 0x0000FFFF
72 
73 
76 typedef enum __orxINPUT_TYPE_t
77 {
84 
86 
87  orxINPUT_TYPE_NONE = orxENUM_NONE
88 
90 
93 typedef enum __orxINPUT_MODE_t
94 {
98 
100 
101  orxINPUT_MODE_NONE = orxENUM_NONE
102 
103 } orxINPUT_MODE;
104 
107 typedef enum __orxINPUT_EVENT_t
108 {
112 
114 
115  orxINPUT_EVENT_NONE = orxENUM_NONE
116 
118 
121 typedef struct __orxINPUT_EVENT_PAYLOAD_t
122 {
123  const orxSTRING zSetName;
124  const orxSTRING zInputName;
128  orxFLOAT afValue[orxINPUT_KU32_BINDING_NUMBER];
131 
132 
135 extern orxDLLAPI void orxFASTCALL orxInput_Setup();
136 
140 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Init();
141 
144 extern orxDLLAPI void orxFASTCALL orxInput_Exit();
145 
146 
151 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Load(const orxSTRING _zFileName);
152 
157 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Save(const orxSTRING _zFileName);
158 
159 
164 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SelectSet(const orxSTRING _zSetName);
165 
169 extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetCurrentSet();
170 
171 
177 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_EnableSet(const orxSTRING _zSetName, orxBOOL _bEnable);
178 
183 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsSetEnabled(const orxSTRING _zSetName);
184 
185 
191 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetTypeFlags(orxU32 _u32AddTypeFlags, orxU32 _u32RemoveTypeFlags);
192 
193 
198 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsActive(const orxSTRING _zInputName);
199 
204 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenActivated(const orxSTRING _zInputName);
205 
210 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenDeactivated(const orxSTRING _zInputName);
211 
216 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasNewStatus(const orxSTRING _zInputName);
217 
222 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetValue(const orxSTRING _zInputName);
223 
229 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetValue(const orxSTRING _zInputName, orxFLOAT _fValue);
230 
236 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetPermanentValue(const orxSTRING _zInputName, orxFLOAT _fValue);
237 
242 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_ResetValue(const orxSTRING _zInputName);
243 
244 
249 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetThreshold(const orxSTRING _zInputName);
250 
256 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetThreshold(const orxSTRING _zInputName, orxFLOAT _fThreshold);
257 
262 extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetMultiplier(const orxSTRING _zInputName);
263 
269 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetMultiplier(const orxSTRING _zInputName, orxFLOAT _fMultiplier);
270 
271 
277 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetCombineMode(const orxSTRING _zName, orxBOOL _bCombine);
278 
283 extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsInCombineMode(const orxSTRING _zName);
284 
285 
294 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Bind(const orxSTRING _zName, orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxS32 _s32BindingIndex);
295 
301 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Unbind(const orxSTRING _zName, orxS32 _s32BindingIndex);
302 
309 extern orxDLLAPI orxU32 orxFASTCALL orxInput_GetBoundInputCount(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
310 
320 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBoundInput(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxU32 _u32InputIndex, const orxSTRING *_pzName, orxU32 *_pu32BindingIndex);
321 
330 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBinding(const orxSTRING _zName, orxU32 _u32BindingIndex, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
331 
339 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]);
340 
341 
348 extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBindingName(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
349 
357 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingType(const orxSTRING _zName, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
358 
365 extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetActiveBinding(orxINPUT_TYPE *_peType, orxENUM *_peID, orxFLOAT *_pfValue);
366 
367 #endif /*_orxINPUT_H_*/
368 
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:107
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:93
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:123
#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)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetTypeFlags(orxU32 _u32AddTypeFlags, orxU32 _u32RemoveTypeFlags)
const orxSTRING zInputName
Definition: orxInput.h:124
orxDLLAPI void orxFASTCALL orxInput_Setup()
orxINPUT_TYPE
Definition: orxInput.h:76
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