From 58623b09bdaa687b8ab541d451cd35d52dca2e7b Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 3 Jan 2018 14:48:18 +0100 Subject: [PATCH] input: add missing has_vibration() method to InputDevice --- panda/src/device/inputDevice.I | 10 ++++++++++ panda/src/device/inputDevice.h | 1 + 2 files changed, 11 insertions(+) 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;