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:07:56 UTC

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

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


##########
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)
+    {
+      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 write(session->fd_mouse, (void *)&sample, sizeof(sample));

Review Comment:
   ```suggestion
     return nx_write(session->fd_mouse, (void *)&sample, sizeof(sample));
   ```



##########
drivers/video/vnc/vnc_server.c:
##########
@@ -284,6 +285,19 @@ int vnc_server(int argc, FAR char *argv[])
   nxsem_set_protocol(&session->vsyncsem, SEM_PRIO_NONE);
 #endif
 
+#ifdef CONFIG_VNCSERVER_MOUSE
+  ret = open(CONFIG_VNCSERVER_MOUSE_DEVNAME, O_WRONLY);

Review Comment:
   ```suggestion
     ret = nx_open(CONFIG_VNCSERVER_MOUSE_DEVNAME, O_WRONLY);
   ```



##########
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)

Review Comment:
   Optional
   ```suggestion
     if ((buttons & MOUSE_BUTTON_1) != 0)
   ```



-- 
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