sif_input_dev = input_allocate_device()
sif_input_dev->name = "sif_event"
set_bit(EV_MSC, sif_input_dev->evbit)
set_bit(MSC_RAW, sif_input_dev->mscbit)
input_register_device(sif_input_dev)
input_event(sif_input_dev, EV_MSC, MSC_RAW, 1)
input_sync(sif_input_dev)
open(INPUT_DEV, O_RDONLY)
read(fd, &event, sizeof(event))
printf("type:%d, code:%d, value:%d\n", event.type, event.code, event.value)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)