试图实现虚拟键盘。该程序在5秒周期内发送击键事件。它在PC(Ubuntu Linux)上工作。问题是Beaglebone Black/Raspberry Pi3没有显示任何内容。虚拟键盘(Linux/libevdev) - 发送事件
Plaftorm Beaglebone黑色,Debian的杰西:
[email protected]:~$ uname -a
Linux beaglebone 4.9.9-ti-r22 #1 SMP PREEMPT Mon Feb 13 18:39:00 UTC 2017 armv7l GNU/Linux
代码:
#include
#include
#include
#include
#include
#include
#include
/* emit function is identical to of the first example */
void emit(int fd, int type, int code, int val)
{
struct input_event ie;
ie.type = type;
ie.code = code;
ie.value = val;
/* timestamp values below are ignored */
ie.time.tv_sec = 0;
ie.time.tv_usec = 0;
int res = write(fd, &ie, sizeof(ie));
printf("emit write bytes=%d fd=%d code=%d v