指令[8086]

文档状态:编辑....



关注问题的发生形成有利于发展的思路


Table of Contents

Problem

    这个很好玩!可以直接用c去操作设备
    //#include <input.h> 引用内核头文件 linux/input.h
    //主要使用input.h的数据结构 input_event
    int fd;
    struct input_event ie;
    fd = open("/dev/input/event5", O_RDONLY);
    read(fd, &ie, sizeof(struct input_event));
    printf("type = %d  code = %d  value = %d\n",
            ie.type, ie.code, ie.value);
    close(fd);