|
|
@ -467,11 +467,15 @@ int main() {
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
dev = udev_monitor_receive_device(mon);
|
|
|
|
dev = udev_monitor_receive_device(mon);
|
|
|
|
if (dev) {
|
|
|
|
if (dev) {
|
|
|
|
|
|
|
|
int reload_keyboards = 0;
|
|
|
|
if (strcmp(udev_device_get_action(dev), "add") == 0) {
|
|
|
|
if (strcmp(udev_device_get_action(dev), "add") == 0) {
|
|
|
|
// Reload keyboards
|
|
|
|
reload_keyboards = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strcmp(udev_device_get_action(dev), "remove") == 0) {
|
|
|
|
if (strcmp(udev_device_get_action(dev), "remove") == 0) {
|
|
|
|
|
|
|
|
reload_keyboards = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
udev_device_unref(dev);
|
|
|
|
|
|
|
|
if( reload_keyboards ) {
|
|
|
|
// Reload keyboards
|
|
|
|
// Reload keyboards
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -507,5 +511,7 @@ int main() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
releaseLock(lockfd, lockFileName);
|
|
|
|
releaseLock(lockfd, lockFileName);
|
|
|
|
|
|
|
|
udev_monitor_unref(mon);
|
|
|
|
|
|
|
|
udev_unref(udev);
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|