mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-02-16 10:30:47 +00:00
Reset the watch key after processing events. watckKey -> watchKey
This commit is contained in:
@@ -91,8 +91,8 @@ public class EvdevLoader implements Runnable {
|
||||
evdev.register(watcher, StandardWatchEventKinds.ENTRY_CREATE);
|
||||
|
||||
for (;;) {
|
||||
WatchKey watckKey = watcher.take();
|
||||
List<WatchEvent<?>> events = watckKey.pollEvents();
|
||||
WatchKey watchKey = watcher.take();
|
||||
List<WatchEvent<?>> events = watchKey.pollEvents();
|
||||
for (WatchEvent event:events) {
|
||||
if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
|
||||
String name = event.context().toString();
|
||||
@@ -102,6 +102,10 @@ public class EvdevLoader implements Runnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!watchKey.reset()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (IOException | InterruptedException ex) {
|
||||
LimeLog.severe(ex.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user