Tast's input.Keyboard method should work even when no physical keyboard is present |
||
Issue descriptionI think that the Tast input package's Keyboard method returns an error when executed on a Chromebox or other device that doesn't have a keyboard attached. This limits the usefulness of the input package. Maybe it could create its own keyboard device if needed. I should look at how evemu handles this (if it does at all).
,
Dec 19
Hmm, good question. I think that Chromeboxes are the main case that I'm thinking of here. Using the virtual keyboard is probably reasonable for tablets, but since external keyboards are the typical input devices on Chromeboxes, it would be good to be able to simulate them in tests.
,
Dec 19
Re #2: Thank you for explanation, and, yes, that makes sense.
,
Dec 26
I think that we probably just need to do what libevdev_set_fd in https://cgit.freedesktop.org/libevdev/tree/libevdev/libevdev.c does, i.e. perform various ioctls.
,
Jan 11
I'm working on this now. It seems easier than I expected. I don't know if it makes sense to give callers the ability to choose which device to use, whether to create a new device, etc. To start out with, I may just make input.Keyboard and friends open a physical device if one already exists and create a temporary fake device otherwise.
,
Jan 11
if you already figured it out how to do it, great! (I'd like to know if it would be possible to support a virtual touchscreen device as well... I don't need it now, but I'd like to know). If not, it should be possible to create a virtual keyboard using libusb, and HID profile that implements keyboard on top of it. Although not sure whether we want to add the libusb dependency.
,
Jan 12
I think that the path that libevdev_uinput_create_from_device() takes when passed LIBEVDEV_UINPUT_OPEN_MANAGED is basically what we need to do: https://cgit.freedesktop.org/libevdev/tree/libevdev/libevdev-uinput.c#n357 I'll leave the door open for creating touchscreen devices, but will probably just focus on keyboards initially. I think that process for touchscreens would be similar (albeit possibly with some more ioctls to set additional properties).
,
Jan 14
derat@ thanks for the tip. good to know it works using libevent. much better than using libusb.
,
Jan 15
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/3222c12dcadf7f256017e920c79873cb39506328 commit 3222c12dcadf7f256017e920c79873cb39506328 Author: Daniel Erat <derat@chromium.org> Date: Tue Jan 15 10:54:47 2019 tast-tests: Make input package get device nodes from sysfs. Make the input package get device nodes from sysfs rather than parsing them from the "Handlers" list in /proc/bus/input/devices. This will make it easier to get virtual devices' nodes in a future change. Also update the devInfo struct to store devices' physical paths. This will be used to identify virtual devices in a future change. BUG=chromium:915965 TEST=updated unit tests, also manually verified that example.Keyboard is still able to inject key events Change-Id: Ic2e448b2865c5798ec3d5080fb66e5aec197af0e Reviewed-on: https://chromium-review.googlesource.com/1407134 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org> Reviewed-by: Shuhei Takahashi <nya@chromium.org> [modify] https://crrev.com/3222c12dcadf7f256017e920c79873cb39506328/src/chromiumos/tast/local/input/keyboard.go [modify] https://crrev.com/3222c12dcadf7f256017e920c79873cb39506328/src/chromiumos/tast/local/input/touch.go [modify] https://crrev.com/3222c12dcadf7f256017e920c79873cb39506328/src/chromiumos/tast/local/input/device.go [modify] https://crrev.com/3222c12dcadf7f256017e920c79873cb39506328/src/chromiumos/tast/local/input/device_test.go |
||
►
Sign in to add a comment |
||
Comment 1 by hidehiko@chromium.org
, Dec 18