Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_query.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_query.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c
index 221073d288a..81044197ae7 100644
--- a/source/blender/windowmanager/intern/wm_event_query.c
+++ b/source/blender/windowmanager/intern/wm_event_query.c
@@ -112,7 +112,7 @@ void WM_event_print(const wmEvent *event)
"wmEvent type:%d/%s, val:%d/%s, "
"prev_type:%d/%s, prev_val:%d/%s, "
"modifier=%s, keymodifier:%d, flag:%s, "
- "mouse:(%d,%d), ascii:'%c', utf8:'%.*s', pointer:%p",
+ "mouse:(%d,%d), utf8:'%.*s', pointer:%p",
event->type,
type_id,
event->val,
@@ -126,7 +126,6 @@ void WM_event_print(const wmEvent *event)
flag_id,
event->xy[0],
event->xy[1],
- event->ascii,
BLI_str_utf8_size(event->utf8_buf),
event->utf8_buf,
(const void *)event);
@@ -401,6 +400,20 @@ void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
/** \} */
/* -------------------------------------------------------------------- */
+/** \name Event Text Queries
+ * \{ */
+
+char WM_event_utf8_to_ascii(const struct wmEvent *event)
+{
+ if (BLI_str_utf8_size(event->utf8_buf) == 1) {
+ return event->utf8_buf[0];
+ }
+ return '\0';
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name Event Preference Mapping
* \{ */