diff --git a/panda/src/device/inputDevice.I b/panda/src/device/inputDevice.I index c10ba4a172..f8be63a9c3 100644 --- a/panda/src/device/inputDevice.I +++ b/panda/src/device/inputDevice.I @@ -118,6 +118,16 @@ has_tracker() const { return ((_flags & IDF_has_tracker) != 0); } +/** + * Returns true if the device has vibration motors that can be controlled by + * calling set_vibration(). + */ +INLINE bool InputDevice:: +has_vibration() const { + LightMutexHolder holder(_lock); + return ((_flags & IDF_has_vibration) != 0); +} + /** * Returns true if the device may be able to provide information about its * battery life. diff --git a/panda/src/device/inputDevice.h b/panda/src/device/inputDevice.h index 3dd5d698af..f4727e0a9c 100644 --- a/panda/src/device/inputDevice.h +++ b/panda/src/device/inputDevice.h @@ -149,6 +149,7 @@ PUBLISHED: INLINE bool has_pointer() const; INLINE bool has_keyboard() const; INLINE bool has_tracker() const; + INLINE bool has_vibration() const; INLINE bool has_battery() const; INLINE PointerData get_pointer() const;