Skip to content

Handling of input devices which identify as both mouse and keyboard  #258

Closed
@laynor

Description

@laynor

Some input devices may identify as both mouse and keyboard. In this case, flutter-pi handles only mouse input, and the keyboard is non-functional.

In our case, the input device is a virtual device created with evdev (which identifies only as a keyboard on my development machine, but for reasons I haven't investigated well, identifies as both pointer and keyboard on the PI).

I worked around the issue checking for keyboard first in user_input.c::on_device_added, but I think in the general case all events should be handled.
While modifying the code from

    // Our workaround for the virtual keyboard, check for keyboard first
    if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) {  
       ...
    }else  if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) {
        ...
    } else if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) {

to

if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) {
   ...
}
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) {
    ...
}
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) {
may be enough, I'm not familiar enough with the code at hand to propose a PR for this

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions