VNC: Add default mouse/keyboard input handlers

This commit is contained in:
Gregory Nutt
2016-04-22 12:48:27 -06:00
parent 3527a5a5d7
commit 47c2b3d4a7
3 changed files with 130 additions and 0 deletions
+24
View File
@@ -48,6 +48,8 @@
#define XK_LATIN1 1
#define XK_XKB_KEYS 1
#include <nuttx/nx/nx.h>
#include <nuttx/video/vnc.h>
#include <nuttx/input/x11_keysymdef.h>
#include <nuttx/input/kbd_codec.h>
@@ -627,4 +629,26 @@ void vnc_key_map(FAR struct vnc_session_s *session, uint16_t keysym,
#endif
}
/****************************************************************************
* Function: vnc_kbdout
*
* Description:
* This is the default keyboard callout function. This is simply wrappers around nx_kdbout(), respectively. When configured using vnc_fbinitialize(), the 'arg' must be the correct NXHANDLE value.
*
* Parameters:
* arg - The NXHANDLE from the NX graphics subsystem
* nch - Number of characters
* ch - An array of input characters.
*
* Returned Value:
* None
*
****************************************************************************/
void vnc_kbdout(FAR void *arg, uint8_t nch, FAR const uint8_t *ch)
{
DEBUGASSERT(arg != NULL);
(void)nx_kbdin((NXHANDLE)arg, nch, ch);
}
#endif /* CONFIG_NX_KBD */
+31
View File
@@ -49,6 +49,9 @@
#include <nuttx/net/net.h>
#include <nuttx/video/rfb.h>
#include <nuttx/video/vnc.h>
#include <nuttx/nx/nx.h>
#include <nuttx/nx/nxglib.h>
#include "vnc_server.h"
@@ -470,3 +473,31 @@ int vnc_client_encodings(FAR struct vnc_session_s *session,
return OK;
}
/****************************************************************************
* Function: vnc_mouse
*
* Description:
* This is the default keyboard/mouse callout function. This is simply a
* wrapper around nx_mousein(). When
* configured using vnc_fbinitialize(), the 'arg' must be the correct
* NXHANDLE value.
*
* Parameters:
* See vnc_mouseout_t and vnc_kbdout_t typde definitions above. These
* callouts have arguments that match the inputs to nx_kbdin() and
* nx_mousein() (if arg is really of type NXHANDLE).
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_NX_XYINPUT
void vnc_mouseout(FAR void *arg, nxgl_coord_t x, nxgl_coord_t y,
uint8_t buttons)
{
DEBUGASSERT(arg != NULL);
(void)nx_mousein((NXHANDLE)arg, x, y, buttons);
}
#endif