forked from SwagSoftware/Kisak-Strike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
platforminputdevice.h
54 lines (41 loc) · 2.29 KB
/
platforminputdevice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// ===== Copyright 1996-2012, Valve Corporation, All rights reserved. =======
//
// Purpose:
//
//===========================================================================//
#ifndef PLATFORMINPUTDEVICE_H
#define PLATFORMINPUTDEVICE_H
#ifdef _WIN32
#pragma once
#endif
#include "basetypes.h"
#include "platform.h"
#include "input_device.h"
class PlatformInputDevice
{
public:
static bool s_Initialized;
static InputDevice_t s_validPlatformInputDevices[INPUT_DEVICE_PLATFORM_COUNT];
static int s_numberPlatformInputDevices[INPUT_DEVICE_PLATFORM_COUNT];
static InputDevice_t s_AllInputDevices;
static const InputDevicePlatform_t s_LocalInputPlatform;
static void InitPlatfromInputDeviceInfo( void );
// Generic Information functions that can handle other platforms
// Input Device information functions
static int GetInputDeviceCountforPlatform( InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
static InputDevice_t GetValidInputDevicesForPlatform( InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
static bool IsInputDeviceValid( InputDevice_t device, InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_ANY );
static const char *GetInputDeviceNameUI( InputDevice_t device ); // Use me to get translated, specific name
static const char *GetInputDeviceNameInternal( InputDevice_t device ); // Use me for internal usage w/ consistency
// Input platform information functions
static InputDevicePlatform_t GetLocalInputDevicePlatform( void );
static bool IsInputDevicePlatformValid( InputDevicePlatform_t platform );
static const char *GetInputDevicePlatformName( InputDevicePlatform_t platform );
static InputDevice_t GetDefaultInputDeviceForPlatform( InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
// methods to convert to/from an InputDevice_t and a 1-based ordinal
static int GetInputDeviceOrdinalForPlatform( InputDevice_t device, InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
static InputDevice_t GetInputDeviceTypefromPlatformOrdinal( int deviceNo, InputDevicePlatform_t platform = INPUT_DEVICE_PLATFORM_LOCAL );
// input device properties
static bool IsInputDeviceAPointer( InputDevice_t device ); // Returns true if the device is treated as a pointer for input.
};
#endif // PLATFORMINPUTDEVICE_H