summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/joypad_linux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd/joypad_linux.cpp')
-rw-r--r--platform/linuxbsd/joypad_linux.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index 6e546c4531..a67428b9a4 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -225,7 +225,7 @@ void JoypadLinux::monitor_joypads(udev *p_udev) {
udev_device_unref(dev);
}
}
- usleep(50000);
+ OS::get_singleton()->delay_usec(50'000);
}
udev_monitor_unref(mon);
}
@@ -250,7 +250,7 @@ void JoypadLinux::monitor_joypads() {
}
}
closedir(input_directory);
- usleep(1000000); // 1s
+ OS::get_singleton()->delay_usec(1'000'000);
}
}
@@ -374,6 +374,12 @@ void JoypadLinux::open_joypad(const char *p_path) {
name = namebuf;
}
+ for (const String &word : name.to_lower().split(" ")) {
+ if (banned_words.has(word)) {
+ return;
+ }
+ }
+
if (ioctl(fd, EVIOCGID, &inpid) < 0) {
close(fd);
return;
@@ -508,7 +514,7 @@ void JoypadLinux::joypad_events_thread_run() {
}
}
if (no_events) {
- usleep(10000); // 10ms
+ OS::get_singleton()->delay_usec(10'000);
}
}
}