当前位置: 首页 > news >正文

用源代码做网站seo高端培训

用源代码做网站,seo高端培训,武清网站建设公司,官网网站搭建测试内核input 事件测试程序。 getevent -lt 命令查看注册的是是event0/1/2/3/4 中的哪一个。 gcc input_test.c -o input_test 编译成可执行程序。将编译的input_test,U盘或ADB push到系统里面,chmod 777 input_test 在 ./input_test input_test.c #…

测试内核input 事件测试程序。

getevent -lt 命令查看注册的是是event0/1/2/3/4 中的哪一个。 
gcc input_test.c -o input_test 编译成可执行程序。

将编译的input_test,U盘或ADB push到系统里面,chmod 777 input_test 在 ./input_test

input_test.c

#include <stdlib.h>
#include <poll.h>
#include <unistd.h>
#include <stddef.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <hcuapi/input.h>
#include <kernel/lib/console.h>#define BUF_SIZE 1024static void print_help(void) {printf("***********************************\n");printf("input test cmds help\n");printf("\tfor example : input_test -i 1\n");printf("\t'i'	1 means event1\n");printf("***********************************\n");
}static int input_test(int argc, char *argv[])
{int fd;struct input_event t;struct pollfd pfd;char input_buf[BUF_SIZE];char *s = "/dev/input/event";long tmp;int x = 0, y = 0, z=0;int event_num = -1;char ch;opterr = 0;optind = 0;while((ch = getopt(argc, argv, "hi:")) != EOF){switch (ch) {case 'h':print_help();return 0;case 'i':tmp = strtoll(optarg, NULL,10);event_num = tmp;break;default:printf("Invalid parameter %c\r\n", ch);print_help();return -1;}}if(event_num == -1){print_help();return -1;}sprintf(input_buf,"/dev/input/event%d",event_num);fd = open(input_buf, O_RDONLY);pfd.fd = fd;pfd.events = POLLIN | POLLRDNORM;if(fd < 0){printf("can't open %s\n",input_buf);return -1;}while (1) {if (poll(&pfd, 1, -1) <= 0)continue;if (read(fd, &t, sizeof(t)) != sizeof(t))continue;printf("type:%d, code:%d, value:%ld\n", t.type, t.code, t.value);if (t.type == EV_KEY) {printf("key %d %s\n", t.code,(t.value) ? "Pressed" : "Released");if (t.code == KEY_POWER && !t.value) {while (read(fd, &t, sizeof(t)) == sizeof(t));break;}}else{if (t.type == EV_ABS){if (t.type == EV_ABS&& t.code == ABS_X) {x = t.value;}if (t.type == EV_ABS && t.code == ABS_Y) {y = t.value;}if (t.type == EV_ABS && t.code == ABS_Z) {z = t.value;}}if (t.type == EV_SYN) {printf("(%4d %4d %4d)\n",x,y,z);}}}close(fd);return 0;
}CONSOLE_CMD(input, NULL, input_test, CONSOLE_CMD_MODE_SELF, "input test, press power to exit test")
http://www.khdw.cn/news/19873.html

相关文章:

  • 寒亭区住房和城乡建设局网站安徽网站关键词优化
  • 免费小说网站怎么做促销活动推广方案
  • Python爬取wordpress青岛网站seo优化
  • 怎么建设一个人自己网站郑州网站制作选择乐云seo
  • 优秀品牌策划方案360手机优化大师安卓版
  • 制作钓鱼网站属于什么罪河源网站seo
  • 网站 手机版 电脑版 怎么做网站竞价推广
  • 郑州英语网站建设单页网站制作教程
  • 网页设计师招聘条件沙坪坝区优化关键词软件
  • 做360网站快速排名软件台州网站seo
  • 城乡和住房建设厅网站首页深圳网络推广营销公司
  • 网站模版建站百度搜索排行榜
  • 定制网站建设简介天津优化代理
  • 东营建设网站公司电话号码seo搜索引擎优化方法
  • 快速搭建外贸网站永久免费国外域名注册
  • 个人做网站法律风险优化是什么意思
  • 公司网站建设服务费计入什么科目武汉seo 网络推广
  • 杭州做网站的谷歌竞价推广教程
  • 网站建设的前期工作基础买淘宝店铺多少钱一个
  • 怎么选择一家好的网站建设公司ui设计培训班哪家好
  • 网站数据库备份还原太原seo自媒体
  • 长春建站企业产品宣传推广方案
  • 巴中市建设局网站怎么在百度发布免费广告
  • 优服优科网站建设公司自己建网站要多少钱
  • 妇女之家网站建设方案贴吧高级搜索
  • 高校图书馆网站建设google推广平台怎么做
  • 东莞活动网站设计模板淮北网站建设
  • 做网站前需要做什么准备推广普通话手抄报简单漂亮
  • 设计教育培训seo基础培训
  • 淘宝店铺装网站导航怎么做无线网络优化是做什么的