Panda3D
inputDeviceManager.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file inputDeviceManager.h
10  * @author rdb
11  * @date 2015-12-09
12  */
13 
14 #ifndef INPUTDEVICEMANAGER_H
15 #define INPUTDEVICEMANAGER_H
16 
17 #include "pandabase.h"
18 #include "lightMutex.h"
19 #include "inputDevice.h"
20 #include "inputDeviceSet.h"
21 
22 #ifdef _WIN32
23 #include "xInputDevice.h"
24 class WinRawInputDevice;
25 #endif
26 
27 /**
28  * This class keeps track of all the devices on a system, and sends out events
29  * when a device has been hot-plugged.
30  *
31  * @since 1.10.0
32  */
33 class EXPCL_PANDA_DEVICE InputDeviceManager {
34 protected:
36  ~InputDeviceManager() = default;
37 
38  static void make_global_ptr();
39 
40 PUBLISHED:
41  InputDeviceSet get_devices() const;
42  InputDeviceSet get_devices(InputDevice::DeviceClass device_class) const;
43 
44  void add_device(InputDevice *device);
45  void remove_device(InputDevice *device);
46 
47  virtual void update();
48 
49  INLINE static InputDeviceManager *get_global_ptr();
50 
51 protected:
52  LightMutex _lock;
53 
54 #ifdef PHAVE_LINUX_INPUT_H
55  InputDeviceSet _inactive_devices;
56 #endif
57 
58  InputDeviceSet _connected_devices;
59 
60  static InputDeviceManager *_global_ptr;
61 };
62 
63 #include "inputDeviceManager.I"
64 
65 #endif
This class keeps track of all the devices on a system, and sends out events when a device has been ho...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Manages a list of InputDevice objects, as returned by various InputDeviceManager methods.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a structure representing a single input device.
Definition: inputDevice.h:53
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a standard, non-reentrant mutex, similar to the Mutex class.
Definition: lightMutex.h:39