Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generating input events #247

Open
mkemlogic opened this issue May 28, 2024 · 1 comment
Open

generating input events #247

mkemlogic opened this issue May 28, 2024 · 1 comment

Comments

@mkemlogic
Copy link

Currently it is possible to play back recorded events with umockdev_testbed_load_evemu_events(). It would be very useful to be able to generate input events directly from the code, similar to umockdev_testbed_uevent(). Maybe there is a way I'm not aware of?

I have tried:

cmd = g_strdup_printf("evemu-event --sync /dev/input/event1 --type EV_SW --code 15 --value 1");
g_assert(g_spawn_command_line_async(cmd, NULL));

but the events are nowhere to be found. evtest does not pick them up when called like that:

cmd = g_strdup_printf("evtest /dev/input/event1");
g_assert(g_spawn_command_line_async(cmd, NULL));

Note that evtest run this way can see events submitted by umockdev_testbed_load_evemu_events().

@mkemlogic
Copy link
Author

I've made this PR mkemlogic#1 as a workaround. This allows me to generate one event at a time, or multiple if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant