Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
InputDeviceManager Class Reference

This class keeps track of all the devices on a system, and sends out events when a device has been hot-plugged. More...

`#include "inputDeviceManager.h"`

## Public Member Functions
void | add_device (InputDevice *device)
| Called when a new device has been discovered.
InputDeviceSet | get_devices () const
| Description: Returns all currently connected devices.
InputDeviceSet | get_devices (InputDevice::DeviceClass device_class) const
| Description: Returns all currently connected devices of the given device class.
void | remove_device (InputDevice *device)
| Called when a device has been removed, or when a device should otherwise no longer be tracked.
virtual void | update ()
| Polls the system to see if there are any new devices.

## Static Public Member Functions
static InputDeviceManager * | get_global_ptr ()
| Returns the singleton InputDeviceManager instance.

## Detailed Description

This class keeps track of all the devices on a system, and sends out events when a device has been hot-plugged.

Since
  1.10.0

Definition at line 33 of file inputDeviceManager.h.

## Member Function Documentation

## ◆ add_device()

void InputDeviceManager::add_device | ( | InputDevice * | device | ) |

Called when a new device has been discovered.

This may also be used to register virtual devices.

This causes a connect-device event to be thrown.

Definition at line 91 of file inputDeviceManager.cxx.

## ◆ get_devices() [1/2]

InputDeviceSet InputDeviceManager::get_devices | ( |  | ) | const

Description: Returns all currently connected devices.

Definition at line 53 of file inputDeviceManager.cxx.

References InputDeviceSet::add_device().

## ◆ get_devices() [2/2]

InputDeviceSet InputDeviceManager::get_devices | ( | InputDevice::DeviceClass | device_class | ) | const

Description: Returns all currently connected devices of the given device class.

Definition at line 69 of file inputDeviceManager.cxx.

References InputDeviceSet::add_device(), and InputDevice::get_device_class.

## ◆ get_global_ptr()

InputDeviceManager * InputDeviceManager::get_global_ptr | ( |  | ) |
| inline static

Returns the singleton InputDeviceManager instance.

Definition at line 17 of file inputDeviceManager.I.

## ◆ remove_device()

void InputDeviceManager::remove_device | ( | InputDevice * | device | ) |

Called when a device has been removed, or when a device should otherwise no longer be tracked.

This causes a disconnect-device event to be thrown.

Definition at line 112 of file inputDeviceManager.cxx.

## ◆ update()

void InputDeviceManager::update | ( |  | ) |
| virtual

Polls the system to see if there are any new devices.

In some implementations this is a no-op.

Definition at line 128 of file inputDeviceManager.cxx.

The documentation for this class was generated from the following files:

- panda/src/device/inputDeviceManager.h
- panda/src/device/inputDeviceManager.cxx
- panda/src/device/inputDeviceManager.I