Panda3D
linuxInputDeviceManager.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 linuxInputDeviceManager.h
10  * @author rdb
11  * @date 2018-01-25
12  */
13 
14 #ifndef LINUXINPUTDEVICEMANAGER_H
15 #define LINUXINPUTDEVICEMANAGER_H
16 
17 #include "inputDeviceManager.h"
18 
19 #ifdef PHAVE_LINUX_INPUT_H
20 
21 /**
22  * This class keeps track of all the devices on a system, and sends out events
23  * when a device has been hot-plugged.
24  */
25 class EXPCL_PANDA_DEVICE LinuxInputDeviceManager final : public InputDeviceManager {
26 private:
27  LinuxInputDeviceManager();
28  ~LinuxInputDeviceManager();
29 
30  InputDevice *consider_add_evdev_device(size_t index);
31  InputDevice *consider_add_js_device(size_t index);
32 
33 public:
34  bool has_virtual_device(unsigned short vendor_id, unsigned short product_id) const;
35 
36  virtual void update();
37 
38 protected:
39  int _inotify_fd;
40 
41  pvector<InputDevice *> _evdev_devices;
42 
43  friend class InputDeviceManager;
44 };
45 
46 #endif // PHAVE_LINUX_INPUT_H
47 
48 #endif
This class keeps track of all the devices on a system, and sends out events when a device has been ho...
virtual void update()
Polls the system to see if there are any new devices.
This is our own Panda specialization on the default STL vector.
Definition: pvector.h:42
This is a structure representing a single input device.
Definition: inputDevice.h:53
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.