summaryrefslogtreecommitdiff
path: root/nuttx/examples/nx/nx_events.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-04 03:19:59 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-04 03:19:59 +0000
commit01fab0c78eeef5461a896847f05caec51d26050f (patch)
tree1a500c7a38318a2d9ee6b40655863d4726c1f2f8 /nuttx/examples/nx/nx_events.c
parent6f348a7102c32164dd7fcc9008bdbd8a810fc5b7 (diff)
downloadpx4-nuttx-01fab0c78eeef5461a896847f05caec51d26050f.tar.gz
px4-nuttx-01fab0c78eeef5461a896847f05caec51d26050f.tar.bz2
px4-nuttx-01fab0c78eeef5461a896847f05caec51d26050f.zip
Enable keypad input
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1411 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nx/nx_events.c')
-rw-r--r--nuttx/examples/nx/nx_events.c48
1 files changed, 10 insertions, 38 deletions
diff --git a/nuttx/examples/nx/nx_events.c b/nuttx/examples/nx/nx_events.c
index a3c7d7830..864b267c8 100644
--- a/nuttx/examples/nx/nx_events.c
+++ b/nuttx/examples/nx/nx_events.c
@@ -41,6 +41,7 @@
#include <sys/types.h>
#include <stdlib.h>
+#include <ctype.h>
#include <semaphore.h>
#include <debug.h>
#include <errno.h>
@@ -78,7 +79,7 @@ static void nxeg_mousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
ubyte buttons, FAR void *arg);
#endif
#ifdef CONFIG_NX_KBD
-static void nxeg_kbdin(NXEGWINDOW hwnd, ubyte nch, const ubyte *ch);
+static void nxeg_kbdin(NXWINDOW hwnd, ubyte nch, const ubyte *ch, FAR void *arg);
#endif
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
@@ -93,7 +94,7 @@ static void nxeg_tbmousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
ubyte buttons, FAR void *arg);
#endif
#ifdef CONFIG_NX_KBD
-static void nxeg_tbkbdin(NXEGWINDOW hwnd, ubyte nch, const ubyte *ch);
+static void nxeg_tbkbdin(NXWINDOW hwnd, ubyte nch, const ubyte *ch, FAR void *arg);
#endif
#endif
@@ -256,11 +257,11 @@ static void nxeg_kbdinfo(ubyte nch, const ubyte *ch)
{
if (isprint(ch[i]))
{
- message(" ch[%d]= (%02x)", i, ch[i]);
+ message(" ch[%d]=%c (%02x)\n", i, ch[i], ch[i]);
}
else
{
- message(" ch[%d]=%c (%02x)", i, ch[i], ch[i]);
+ message(" ch[%d]= (%02x)\n", i, ch[i]);
}
}
}
@@ -271,9 +272,9 @@ static void nxeg_kbdinfo(ubyte nch, const ubyte *ch)
****************************************************************************/
#ifdef CONFIG_NX_KBD
-static void nxeg_kbdin(NXEGWINDOW hwnd, ubyte nch, const ubyte *ch)
+static void nxeg_kbdin(NXWINDOW hwnd, ubyte nch, const ubyte *ch, FAR void *arg)
{
- message("nxeg_kbdin: hwnd=%p nch=%d\n", hwnd, nch);
+ message("nxeg_kbdin%d: hwnd=%p nch=%d\n", (int)arg, hwnd, nch);
nxeg_kbdinfo(nch, ch);
}
#endif
@@ -333,45 +334,16 @@ static void nxeg_tbmousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
#ifdef CONFIG_NX_KBD
-static void nxeg_tbkbdin(NXEGWINDOW hwnd, ubyte nch, const ubyte *ch)
+static void nxeg_tbkbdin(NXWINDOW hwnd, ubyte nch, const ubyte *ch, FAR void *arg)
{
- message("nxeg_tbkbdin: ERROR -- toolbar should not received keyboard input\n";
- message("nxeg_tbkbdin: hwnd=%p nch=%d\n", hwnd, nch);
+ message("nxeg_tbkbdin: ERROR -- toolbar should not received keyboard input\n");
+ message("nxeg_tbkbdin%d: hwnd=%p nch=%d\n", (int)arg, hwnd, nch);
nxeg_kbdinfo(nch, ch);
}
#endif
#endif
/****************************************************************************
- * Name: nxeg_kbdin2
- ****************************************************************************/
-
-#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
-#ifdef CONFIG_NX_KBD
-static void nxeg_kbdin2(NXEGWINDOW hwnd, ubyte nch, const ubyte *ch)
-{
- message("nxeg_kbdin2: hwnd=%p nch=%d\n", hwnd, nch);
- nxeg_kbdinfo(nch, ch);
-}
-#endif
-#endif
-
-/****************************************************************************
- * Name: nxeg_mousein2
- ****************************************************************************/
-
-#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
-#ifdef CONFIG_NX_MOUSE
-static void nxeg_mousein2(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
- ubyte buttons, FAR void *arg)
-{
- message("nxeg_mousein%d: hwnd=%p pos=(%d,%d) button=%02x\n",
- (int)arg, hwnd, pos->x, pos->y, buttons);
-}
-#endif
-#endif
-
-/****************************************************************************
* Public Functions
****************************************************************************/