diff --git a/include/nuttx/input/keyboard.h b/include/nuttx/input/keyboard.h index 98b408a4d64..694f13daf8a 100644 --- a/include/nuttx/input/keyboard.h +++ b/include/nuttx/input/keyboard.h @@ -31,6 +31,7 @@ #include +#include #include #include @@ -38,8 +39,22 @@ * Pre-processor Definitions ****************************************************************************/ -#define KEYBOARD_PRESS 0 /* Key press event */ -#define KEYBOARD_RELEASE 1 /* Key release event */ +/* Values for the type field of struct keyboard_event_s. + * + * A normal key carries its character in the code field. A special key + * carries a value from enum kbd_keycode_e instead, and must be reported + * with one of the SPEC types: the two ranges overlap, so the type is the + * only way a consumer can tell an arrow key from the character that shares + * its value. + * + * These are aliases of the kbd_decode() return values so that a driver can + * feed both this interface and the byte stream codec from a single source. + */ + +#define KEYBOARD_PRESS KBD_PRESS /* Normal key press event */ +#define KEYBOARD_RELEASE KBD_RELEASE /* Normal key release event */ +#define KEYBOARD_SPECPRESS KBD_SPECPRESS /* Special key press event */ +#define KEYBOARD_SPECREL KBD_SPECREL /* Special key release event */ /**************************************************************************** * Public Types