orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
orxInput.h
Go to the documentation of this file.
1/* Orx - Portable Game Engine
2 *
3 * Copyright (c) 2008- 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
32
41
42
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_DEFAULT_THRESHOLD "DefaultThreshold"
58#define orxINPUT_KZ_CONFIG_DEFAULT_MULTIPLIER "DefaultMultiplier"
59#define orxINPUT_KZ_CONFIG_COMBINE_LIST "CombineList"
60#define orxINPUT_KZ_CONFIG_JOYSTICK_ID_LIST "JoyIDList"
61
62#define orxINPUT_KU32_BINDING_NUMBER 16
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
90
104
119
132
133
136extern orxDLLAPI void orxFASTCALL orxInput_Setup();
137
141extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Init();
142
145extern orxDLLAPI void orxFASTCALL orxInput_Exit();
146
147
152extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Load(const orxSTRING _zFileName);
153
158extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Save(const orxSTRING _zFileName);
159
160
165extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SelectSet(const orxSTRING _zSetName);
166
170extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetCurrentSet();
171
176extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetNextSet(const orxSTRING _zSetName);
177
182extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_PushSet(const orxSTRING _zSetName);
183
188
193extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_RemoveSet(const orxSTRING _zSetName);
194
195
201extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_EnableSet(const orxSTRING _zSetName, orxBOOL _bEnable);
202
207extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsSetEnabled(const orxSTRING _zSetName);
208
209
214extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_ClearSet(const orxSTRING _zSetName);
215
216
222extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetTypeFlags(orxU32 _u32AddTypeFlags, orxU32 _u32RemoveTypeFlags);
223
224
229extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetNext(const orxSTRING _zInputName);
230
235extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsActive(const orxSTRING _zInputName);
236
241extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenActivated(const orxSTRING _zInputName);
242
247extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenDeactivated(const orxSTRING _zInputName);
248
253extern orxDLLAPI orxBOOL orxFASTCALL orxInput_HasNewStatus(const orxSTRING _zInputName);
254
259extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetValue(const orxSTRING _zInputName);
260
266extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetValue(const orxSTRING _zInputName, orxFLOAT _fValue);
267
273extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetPermanentValue(const orxSTRING _zInputName, orxFLOAT _fValue);
274
279extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_ResetValue(const orxSTRING _zInputName);
280
281
286extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetThreshold(const orxSTRING _zInputName);
287
293extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetThreshold(const orxSTRING _zInputName, orxFLOAT _fThreshold);
294
299extern orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetMultiplier(const orxSTRING _zInputName);
300
306extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetMultiplier(const orxSTRING _zInputName, orxFLOAT _fMultiplier);
307
308
314extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetCombineMode(const orxSTRING _zName, orxBOOL _bCombine);
315
320extern orxDLLAPI orxBOOL orxFASTCALL orxInput_IsInCombineMode(const orxSTRING _zName);
321
322
331extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Bind(const orxSTRING _zName, orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxS32 _s32BindingIndex);
332
338extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_Unbind(const orxSTRING _zName, orxS32 _s32BindingIndex);
339
346extern orxDLLAPI orxU32 orxFASTCALL orxInput_GetBoundInputCount(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
347
357extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBoundInput(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxU32 _u32InputIndex, const orxSTRING *_pzName, orxU32 *_pu32BindingIndex);
358
367extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBinding(const orxSTRING _zName, orxU32 _u32BindingIndex, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
368
377
378
385extern orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBindingName(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode);
386
394extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBindingType(const orxSTRING _zName, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode);
395
402extern orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetActiveBinding(orxINPUT_TYPE *_peType, orxENUM *_peID, orxFLOAT *_pfValue);
403
404#endif /*_orxINPUT_H_*/
405
#define orxDLLAPI
Definition orxDecl.h:381
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetThreshold(const orxSTRING _zInputName, orxFLOAT _fThreshold)
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetNext(const orxSTRING _zInputName)
orxDLLAPI void orxFASTCALL orxInput_Setup()
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetCombineMode(const orxSTRING _zName, orxBOOL _bCombine)
orxINPUT_TYPE
Definition orxInput.h:77
orxDLLAPI orxSTATUS orxFASTCALL orxInput_ClearSet(const orxSTRING _zSetName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_ResetValue(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)
orxDLLAPI orxBOOL orxFASTCALL orxInput_IsSetEnabled(const orxSTRING _zSetName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_RemoveSet(const orxSTRING _zSetName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetPermanentValue(const orxSTRING _zInputName, orxFLOAT _fValue)
orxDLLAPI void orxFASTCALL orxInput_Exit()
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetNextSet(const orxSTRING _zSetName)
orxDLLAPI orxBOOL orxFASTCALL orxInput_IsActive(const orxSTRING _zInputName)
orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenDeactivated(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_PushSet(const orxSTRING _zSetName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Init()
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 orxSTATUS orxFASTCALL orxInput_GetBindingType(const orxSTRING _zName, orxINPUT_TYPE *_peType, orxENUM *_peID, orxINPUT_MODE *_peMode)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetBoundInput(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxU32 _u32InputIndex, const orxSTRING *_pzName, orxU32 *_pu32BindingIndex)
orxINPUT_MODE
Definition orxInput.h:94
orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetThreshold(const orxSTRING _zInputName)
orxDLLAPI orxBOOL orxFASTCALL orxInput_IsInCombineMode(const orxSTRING _zName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_EnableSet(const orxSTRING _zSetName, orxBOOL _bEnable)
orxDLLAPI orxU32 orxFASTCALL orxInput_GetBoundInputCount(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode)
orxDLLAPI orxBOOL orxFASTCALL orxInput_HasBeenActivated(const orxSTRING _zInputName)
orxINPUT_EVENT
Definition orxInput.h:108
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SelectSet(const orxSTRING _zSetName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetValue(const orxSTRING _zInputName, orxFLOAT _fValue)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_GetActiveBinding(orxINPUT_TYPE *_peType, orxENUM *_peID, orxFLOAT *_pfValue)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_PopSet()
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetCurrentSet()
orxDLLAPI orxBOOL orxFASTCALL orxInput_HasNewStatus(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Save(const orxSTRING _zFileName)
#define orxINPUT_KU32_BINDING_NUMBER
Definition orxInput.h:62
orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetMultiplier(const orxSTRING _zInputName)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Load(const orxSTRING _zFileName)
orxDLLAPI orxFLOAT orxFASTCALL orxInput_GetValue(const orxSTRING _zInputName)
orxDLLAPI const orxSTRING orxFASTCALL orxInput_GetBindingName(orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Unbind(const orxSTRING _zName, orxS32 _s32BindingIndex)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_Bind(const orxSTRING _zName, orxINPUT_TYPE _eType, orxENUM _eID, orxINPUT_MODE _eMode, orxS32 _s32BindingIndex)
orxDLLAPI orxSTATUS orxFASTCALL orxInput_SetMultiplier(const orxSTRING _zInputName, orxFLOAT _fMultiplier)
@ orxINPUT_TYPE_KEYBOARD_KEY
Definition orxInput.h:78
@ orxINPUT_TYPE_EXTERNAL
Definition orxInput.h:83
@ orxINPUT_TYPE_JOYSTICK_AXIS
Definition orxInput.h:82
@ orxINPUT_TYPE_JOYSTICK_BUTTON
Definition orxInput.h:81
@ orxINPUT_TYPE_NONE
Definition orxInput.h:87
@ orxINPUT_TYPE_MOUSE_BUTTON
Definition orxInput.h:79
@ orxINPUT_TYPE_NUMBER
Definition orxInput.h:85
@ orxINPUT_TYPE_MOUSE_AXIS
Definition orxInput.h:80
@ orxINPUT_MODE_FULL
Definition orxInput.h:95
@ orxINPUT_MODE_POSITIVE
Definition orxInput.h:96
@ orxINPUT_MODE_NONE
Definition orxInput.h:101
@ orxINPUT_MODE_NEGATIVE
Definition orxInput.h:97
@ orxINPUT_MODE_NUMBER
Definition orxInput.h:99
@ orxINPUT_EVENT_REMOVE_SET
Definition orxInput.h:112
@ orxINPUT_EVENT_SELECT_SET
Definition orxInput.h:111
@ orxINPUT_EVENT_OFF
Definition orxInput.h:110
@ orxINPUT_EVENT_ON
Definition orxInput.h:109
@ orxINPUT_EVENT_NUMBER
Definition orxInput.h:114
@ orxINPUT_EVENT_NONE
Definition orxInput.h:116
orxSTATUS
Definition orxType.h:270
const orxSTRING zInputName
Definition orxInput.h:125
const orxSTRING zSetName
Definition orxInput.h:124
orxFLOAT afValue[orxINPUT_KU32_BINDING_NUMBER]
Definition orxInput.h:129
orxENUM aeID[orxINPUT_KU32_BINDING_NUMBER]
Definition orxInput.h:127
orxINPUT_MODE aeMode[orxINPUT_KU32_BINDING_NUMBER]
Definition orxInput.h:128
orxINPUT_TYPE aeType[orxINPUT_KU32_BINDING_NUMBER]
Definition orxInput.h:126

Generated for orx by doxygen 1.8.11