国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

用源代碼做網(wǎng)站2020國內(nèi)十大小說網(wǎng)站排名

用源代碼做網(wǎng)站,2020國內(nèi)十大小說網(wǎng)站排名,網(wǎng)站302怎么做,深圳市創(chuàng)同盟科技有限公司測試內(nèi)核input 事件測試程序。 getevent -lt 命令查看注冊(cè)的是是event0/1/2/3/4 中的哪一個(gè)。 gcc input_test.c -o input_test 編譯成可執(zhí)行程序。將編譯的input_test,U盤或ADB push到系統(tǒng)里面,chmod 777 input_test 在 ./input_test input_test.c #…

測試內(nèi)核input 事件測試程序。

getevent -lt 命令查看注冊(cè)的是是event0/1/2/3/4 中的哪一個(gè)。 
gcc input_test.c -o input_test 編譯成可執(zhí)行程序。

將編譯的input_test,U盤或ADB push到系統(tǒng)里面,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://aloenet.com.cn/news/46852.html

相關(guān)文章:

  • 什么是門戶網(wǎng)站廣告我想自己建立一個(gè)網(wǎng)站
  • 動(dòng)畫畢業(yè)設(shè)計(jì)代做網(wǎng)站鄭州百度網(wǎng)站優(yōu)化排名
  • 圖片類網(wǎng)站建設(shè)百度推廣年費(fèi)多少錢
  • 搜索引擎網(wǎng)站有哪些windows優(yōu)化大師是哪個(gè)公司的
  • 電子商務(wù)網(wǎng)站建設(shè)問題百度游戲app下載
  • 怎么用視頻做網(wǎng)站背景重慶seo優(yōu)化公司
  • 東營做網(wǎng)站優(yōu)化的公司軟文廣告案例
  • 杭州網(wǎng)站建設(shè)公司官網(wǎng)頁面設(shè)計(jì)漂亮的網(wǎng)站
  • 武漢單位做網(wǎng)站網(wǎng)站建設(shè)優(yōu)化400報(bào)價(jià)
  • wordpress使用手機(jī)號(hào)登錄上海網(wǎng)站seoseodian
  • 現(xiàn)在建一個(gè)網(wǎng)站一年費(fèi)用只要幾百元南寧百度首頁優(yōu)化
  • 金華市網(wǎng)站建設(shè)seo網(wǎng)絡(luò)推廣方法
  • 手機(jī)網(wǎng)站如何制作免費(fèi)百度云網(wǎng)盤資源分享網(wǎng)站
  • 一屏展示網(wǎng)站咸寧網(wǎng)站seo
  • 真正永久免費(fèi)網(wǎng)絡(luò)電話seo搜索引擎優(yōu)化原理
  • 網(wǎng)站開發(fā)教程 模板媒體公關(guān)
  • 不良網(wǎng)站代碼怎么查行者seo無敵
  • 網(wǎng)站關(guān)鍵詞優(yōu)化到首頁難度專業(yè)軟文發(fā)稿平臺(tái)
  • 柯基寧波seo企業(yè)網(wǎng)絡(luò)推廣
  • 網(wǎng)站建立于網(wǎng)頁設(shè)計(jì)搜索引擎的優(yōu)化和推廣
  • 網(wǎng)站圖片滾動(dòng)是怎么做的seo是做什么工作內(nèi)容
  • 建設(shè)網(wǎng)站目的及功能定位百度收錄規(guī)則2022
  • dedecms手機(jī)網(wǎng)站插件網(wǎng)絡(luò)營銷方案策劃論文
  • 延吉最好的網(wǎng)站建設(shè)公司張家界百度seo
  • 貴州網(wǎng)站開發(fā)公司seo培訓(xùn)優(yōu)化課程
  • logo設(shè)計(jì)公司怎么去跟客戶談山西搜索引擎優(yōu)化
  • 網(wǎng)站建設(shè)優(yōu)化一年賺幾十萬seo搜索引擎優(yōu)化軟件
  • 網(wǎng)頁布局設(shè)計(jì)的一般步驟seo全網(wǎng)優(yōu)化推廣
  • 幾十元做網(wǎng)站濰坊快速網(wǎng)站排名
  • 網(wǎng)站設(shè)置黑白色快速建站哪個(gè)平臺(tái)好