Input preferences: use correct API for watch_input_devices()
We now use the same API as BeOS for input devices notification. Change-Id: I873c7556c039d0628af306bb7d157cc06a5cd652 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3873 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
04be20a75a
commit
eb87d690be
@ -104,16 +104,16 @@ InputWindow::MessageReceived(BMessage* message)
|
||||
break;
|
||||
}
|
||||
|
||||
case IS_NOTIFY_DEVICE:
|
||||
case B_INPUT_DEVICES_CHANGED:
|
||||
{
|
||||
bool added = message->FindBool("added");
|
||||
BString name = message->FindString("name");
|
||||
int32 operation = message->FindInt32("be:opcode");
|
||||
BString name = message->FindString("be:device_name");
|
||||
|
||||
if (added) {
|
||||
if (operation == B_INPUT_DEVICE_ADDED) {
|
||||
BInputDevice* device = find_input_device(name);
|
||||
if (device)
|
||||
AddDevice(device);
|
||||
} else {
|
||||
} else if (operation == B_INPUT_DEVICE_REMOVED) {
|
||||
for (int i = 0; i < fDeviceListView->CountItems(); i++) {
|
||||
DeviceListItemView* item
|
||||
= dynamic_cast<DeviceListItemView*>(
|
||||
|
Loading…
Reference in New Issue
Block a user