Skip to content

Commit 9e7df57

Browse files
committed
fix(Intercept Mode): don't clear gamepad states if mode does not change
1 parent 8425f13 commit 9e7df57

File tree

1 file changed

+5
-1
lines changed
  • src/input/composite_device

1 file changed

+5
-1
lines changed

src/input/composite_device/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,11 @@ impl CompositeDevice {
12381238

12391239
/// Sets the intercept mode to the given value
12401240
async fn set_intercept_mode(&mut self, mode: InterceptMode) {
1241-
log::debug!("Setting intercept mode to: {:?}", mode);
1241+
log::debug!("Setting intercept mode to: {mode:?}");
1242+
if self.intercept_mode == mode {
1243+
log::debug!("Intercept is already set to: {mode:?}");
1244+
return;
1245+
}
12421246
self.intercept_mode = mode;
12431247

12441248
// Nothing else is required when turning off input interception.

0 commit comments

Comments
 (0)