ch579 蓝牙鼠标问题

在ch579蓝牙鼠标的例子中,模拟不了双击,不知道是怎么回事,求解

一个双击事件是:

    按下->弹起, ->再按下->再弹起的过程,

 换句话说, 你需要最起码发送4次,才能让操作系统识别为你是双击

把官网的sdk 的ble mouse 的对应的这个event的代码这样写,就可以实现双击了

(注意wch 的ble是查询实现的, 是不能有阻塞操作的)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if ( events & START_REPORT_EVT )
{
      static uint8_t report_state =0;
      switch(report_state) {
          case 0:
              PRINT("report_1st press\r\n");
              hidEmuSendMouseReport( 0x01 , 0 , 0 );
              break;
          case 1:
              PRINT("report_1st release\r\n");
              hidEmuSendMouseReport( 0x00 , 0 , 0 );
              break;
          case 10:
              PRINT("report_2nd press\r\n");
              hidEmuSendMouseReport( 0x01 , 0 , 0 );
              break;
          case 11:
              PRINT("report_2nd release\r\n");
              hidEmuSendMouseReport( 0x00 , 0 , 0 );
              break;
          default:
              break;
      } 
      report_state ++;
      tmos_start_task( hidEmuTaskId, START_REPORT_EVT, 16 );
      return ( events ^ START_REPORT_EVT );
  }




只有登录才能回复,可以选择微信账号登录