From 01bce341a9d065e8250f655c246c07a525779bc0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 20 May 2012 18:56:14 +0000 Subject: NxWM::CNxConsole and NXWidgets::CCallback can now redirect keyboard input to the NxConsole driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4754 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/libnxwidgets/include/ccallback.hxx | 32 ++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'NxWidgets/libnxwidgets/include/ccallback.hxx') diff --git a/NxWidgets/libnxwidgets/include/ccallback.hxx b/NxWidgets/libnxwidgets/include/ccallback.hxx index 09cb83a8a..8d3c13cd2 100644 --- a/NxWidgets/libnxwidgets/include/ccallback.hxx +++ b/NxWidgets/libnxwidgets/include/ccallback.hxx @@ -48,7 +48,10 @@ #include #include -#include + +#ifdef CONFIG_NXCONSOLE_NXKBDIN +# include +#endif #include "crect.hxx" @@ -88,7 +91,11 @@ namespace NXWidgets class CCallback { private: - struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ + CWidgetControl *m_widgetControl; /**< The widget control instance for this window */ + struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ +#ifdef CONFIG_NXCONSOLE_NXKBDIN + NXCONSOLE m_nxconsole; /**< The NxConsole handle for redirection of keyboard input */ +#endif // Methods in the callback vtable @@ -235,6 +242,27 @@ namespace NXWidgets { return &m_callbacks; } + + /** + * By default, NX keyboard input is given to the various widgets + * residing in the window. But NxConsole is a different usage model; + * In this case, keyboard input needs to be directed to the NxConsole + * character driver. This method can be used to enable (or disable) + * redirection of NX keyboard input from the window widgets to the + * NxConsole + * + * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard + * input will be directed to the NxConsole driver using this + * handle; If NULL (the default), NX keyboard input will be + * directed to the widgets within the window. + */ + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + inline void setNxConsole(NXCONSOLE handle) + { + m_nxconsole = handle; + } +#endif }; } -- cgit v1.2.3