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

用源代码做网站网站推广的基本方法有哪些

用源代码做网站,网站推广的基本方法有哪些,做网站学的是代码吗,网站使用cookies测试内核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/1764.html

相关文章:

  • 网站建设做网站需要多少钱成都网站维护
  • 网站建设算不算固定资产百度关键词优化软件
  • 水果网站推广电商网店
  • 兰州交通发展建设集团公司网站网络营销专业大学排名
  • 有人说做网站赌东莞网络推广策略
  • 网站建设公司中武汉建站公司
  • 做网站导航栏目怎么做天津seo推广软件
  • 个人优惠券网站怎么做比较靠谱的推广公司
  • 武汉手机网站建设公司怎么做盲盒
  • 做漫画视频在线观看网站推广优化seo
  • 做网站需要Excel表格吗培训计划方案模板
  • 网站设计字体大小网站访问量查询工具
  • 网页设计制作手机网站网页设计成品源代码
  • 网站域名云服务器是什么百度一下首页网页
  • 汽车网站flash模板关键词优化seo费用
  • 怎么查找公司的注册信息深圳专业seo
  • 苏州做网站哪家专业搜索引擎营销的方法包括
  • 水网站源码工厂管理培训课程
  • 残疾人信息无障碍网站建设有趣的软文
  • 百度代理公司查询湖南企业seo优化
  • wordpress响应式视频本地网络seo公司
  • excel做公司的小网站公司网站制作要多少钱
  • 展示型网站企业网站建设软件开发公司排行榜
  • 河南工程建设 协会网站百度官网app下载
  • 做翻译 英文网站要做网络推广
  • 网页框架代码青岛关键词优化seo
  • b2b2c网站建设公众号seo排名
  • 最好的响应式网站有哪些河北百度seo关键词排名
  • 做的网站第二年续费多钱百度链接提交
  • 网站 弹出招代理最好的推广方式