diff include/SDL_events.h @ 3280:00cace2d9080

Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
author Sam Lantinga <slouken@libsdl.org>
date Sat, 19 Sep 2009 13:29:40 +0000
parents 91b335df6fc8
children d3baf5ac4e37
line wrap: on
line diff
--- a/include/SDL_events.h	Sat Sep 19 12:48:52 2009 +0000
+++ b/include/SDL_events.h	Sat Sep 19 13:29:40 2009 +0000
@@ -60,6 +60,7 @@
     SDL_WINDOWEVENT,            /**< Window state change */
     SDL_KEYDOWN,                /**< Keys pressed */
     SDL_KEYUP,                  /**< Keys released */
+    SDL_TEXTEDITING,            /**< Keyboard text editing (composition) */
     SDL_TEXTINPUT,              /**< Keyboard text input */
     SDL_MOUSEMOTION,            /**< Mouse moved */
     SDL_MOUSEBUTTONDOWN,        /**< Mouse button pressed */
@@ -97,6 +98,7 @@
     SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
     SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
     SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
+    SDL_TEXTEDITINGMASK = SDL_EVENTMASK(SDL_TEXTEDITING),
     SDL_TEXTINPUTMASK = SDL_EVENTMASK(SDL_TEXTINPUT),
     SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
     SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
@@ -149,6 +151,20 @@
 } SDL_KeyboardEvent;
 
 /**
+ * \struct SDL_TextEditingEvent
+ *
+ * \brief Keyboard text editing event structure (event.edit.*)
+ */
+#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
+typedef struct SDL_TextEditingEvent
+{
+    Uint8 type;                                 /**< SDL_TEXTEDITING */
+    char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
+    int start;                                  /**< The start cursor of selected editing text */
+    int length;                                 /**< The length of selected editing text */
+} SDL_TextEditingEvent;
+
+/**
  * \struct SDL_TextInputEvent
  *
  * \brief Keyboard text input event structure (event.text.*)
@@ -350,6 +366,7 @@
     Uint8 type;                     /**< Event type, shared with all events */
     SDL_WindowEvent window;         /**< Window event data */
     SDL_KeyboardEvent key;          /**< Keyboard event data */
+    SDL_TextEditingEvent edit;      /**< Text editing event data */
     SDL_TextInputEvent text;        /**< Text input event data */
     SDL_MouseMotionEvent motion;    /**< Mouse motion event data */
     SDL_MouseButtonEvent button;    /**< Mouse button event data */