summaryrefslogtreecommitdiff
path: root/src/devices/input_device.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-09-19 12:02:54 +1200
committerBen Bridle <ben@derelict.engineering>2025-09-19 12:05:46 +1200
commit1836ac3c6b2abd5dce487f1d7589cfe7466c0fd2 (patch)
treed1e34ba91f7ecef855dc9652ca2063ac33dabf6c /src/devices/input_device.rs
parent661b4012654c8b41a782adf6a5cc1092b8942803 (diff)
downloadbedrock-pc-1836ac3c6b2abd5dce487f1d7589cfe7466c0fd2.zip
Gate gamepad support behind a feature flag
This is to make it possible to compile bedrock-pc without gamepad support, which is useful when the target platform doesn't have the libraries for udev (required by the gilrs dependency). This commit is a bit of a hack, it'd be nice to implement this better some day.
Diffstat (limited to 'src/devices/input_device.rs')
-rw-r--r--src/devices/input_device.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/devices/input_device.rs b/src/devices/input_device.rs
index d4e0cb0..3ebeb4c 100644
--- a/src/devices/input_device.rs
+++ b/src/devices/input_device.rs
@@ -132,6 +132,7 @@ impl InputDevice {
}
}
+ #[cfg(feature = "gamepad")]
pub fn on_gamepad_event(&mut self, event: gilrs::Event) {
if let Some(g) = self.gamepad_1.register(event.id) {
self.wake |= g.process_event(&event); return; }