You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/06 09:50:11 UTC

[GitHub] [incubator-nuttx] no1wudi commented on a diff in pull request #6576: vncserver: Support pointer event by uinput

no1wudi commented on code in PR #6576:
URL: https://github.com/apache/incubator-nuttx/pull/6576#discussion_r914645092


##########
drivers/video/vnc/vnc_fbdev.c:
##########
@@ -470,6 +472,42 @@ static int up_waitforsync(FAR struct fb_vtable_s *vtable)
 }
 #endif
 
+#ifdef CONFIG_VNCSERVER_MOUSE
+
+/****************************************************************************
+ * Name: vnc_uinput_mousein
+ ****************************************************************************/
+
+static int vnc_uinput_mouseout(FAR void *arg, int16_t x,
+                               int16_t y, uint8_t buttons)
+{
+  FAR struct vnc_session_s *session = arg;
+  struct touch_sample_s sample;
+
+  DEBUGASSERT(session);
+
+  sample.npoints = 1;
+  sample.point[0].x = x;
+  sample.point[0].y = y;
+
+  if ((buttons & MOUSE_BUTTON_1) != 0)
+    {
+      sample.point[0].flags = TOUCH_DOWN |
+                              TOUCH_ID_VALID |
+                              TOUCH_POS_VALID;
+    }
+  else
+    {
+      sample.point[0].flags = TOUCH_UP |
+                              TOUCH_ID_VALID |
+                              TOUCH_POS_VALID;
+    }
+
+  return nx_write(session->fd_mouse, (void *)&sample, sizeof(sample));

Review Comment:
   This causes VNC mouse driver's private data and VNC session to be coupled together.
   And write to uinput is more simple (it's logic is very similar to uinput).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org