diff --git a/panda/src/device/evdevInputDevice.cxx b/panda/src/device/evdevInputDevice.cxx index 73e247462b..3d7388f3bf 100644 --- a/panda/src/device/evdevInputDevice.cxx +++ b/panda/src/device/evdevInputDevice.cxx @@ -274,6 +274,10 @@ init_device() { } } + if (test_bit(KEY_A, keys) && test_bit(KEY_Z, keys)) { + _flags |= IDF_has_keyboard; + } + // Check device type. if (test_bit(BTN_GAMEPAD, keys)) { _device_class = DC_gamepad; @@ -286,6 +290,9 @@ init_device() { } else if (test_bit(BTN_WHEEL, keys)) { _device_class = DC_steering_wheel; + + } else if (_flags & IDF_has_keyboard) { + _device_class = DC_keyboard; } } diff --git a/panda/src/device/inputDevice.cxx b/panda/src/device/inputDevice.cxx index 0b4279e34e..f1e6a7fbb6 100644 --- a/panda/src/device/inputDevice.cxx +++ b/panda/src/device/inputDevice.cxx @@ -283,11 +283,17 @@ output(ostream &out) const { } if (_buttons.size() > 0) { - out << ", " << _buttons.size() << " buttons"; + out << ", " << _buttons.size() << " button"; + if (_buttons.size() != 1) { + out.put('s'); + } } if (_controls.size() > 0) { - out << ", " << _controls.size() << " controls"; + out << ", " << _controls.size() << " control"; + if (_controls.size() != 1) { + out.put('s'); + } } if (_flags & IDF_has_pointer) {