mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
VNC: Add default mouse/keyboard input handlers
This commit is contained in:
@@ -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 */
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user