minigui增加tslib触摸屏响应

1、修改minigui库中IAL的输入引擎,增加对触摸屏的操作

        定义: static struct tsdev *ts;

         打开:

             ts = ts_open ("/dev/input/event0", 0);

             ts_config(ts);

         关闭:

              ts_close(ts);

         读取:

        int   fd = ts_fd(ts); 

        if ((which & IAL_MOUSEEVENT) && fd >= 0) 

        {
           printf("which is %d ",which);
              FD_SET (fd, in);
        }
      e = select (FD_SETSIZE, in, out, except, timeout) ;
       if (e > 0)
       {        
             if (fd > 0 && FD_ISSET (fd, in))
               {
                   FD_CLR (fd, in);
                   ts_event.x=0;
                  ts_event.y=0;
                  ret = ts_read(ts, &sample, 1);
                  if (ret < 0)
                  {
                        perror("ts_read()");
                        exit(-1);
                  }
                  ts_event.x = sample.x;
                  ts_event.y = sample.y;
                  ts_event.pressure = (sample.pressure > 0 ? 4:0);
                  ret |= IAL_MOUSEEVENT;
                  return (ret);
   }

2、编译minigui库时,增加tslib库的头文件和路径

./configure CC=arm-linux-gcc --build=i686-pc-linux --target=arm-linux --host=arm-linux --disable-galqvfb --disable-galecoslcd --
disable-vbfsupport --prefix=/usr/local/arm/3.4.1/arm-linux CFLAGS="-I/usr/local/arm/3.4.1/arm-linux/include -L/usr/local/arm/3.4.1/arm-linux/lib -lts"

3、应用程序中,增加 MSG_LBUTTONDOWN   MSG_LBUTTONUP消息响应,进行测试

    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

为伊痴狂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值