diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-01-10 13:22:28 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-01-10 13:43:24 +0200 |
commit | b3d803c901aff31bf5315e5ea712d52d607a8c70 (patch) | |
tree | dc99f1445c24744d3dd6b31ff2821d29c3eb3f74 /platform/osx/os_osx.h | |
parent | aebdc4c2126789b915b0fb753f0594fec0f0226d (diff) |
Fix IME producing multiple events per key press.
Diffstat (limited to 'platform/osx/os_osx.h')
-rw-r--r-- | platform/osx/os_osx.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 3648d41604..a1869497ef 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -52,6 +52,21 @@ class OS_OSX : public OS_Unix { public: + enum { + KEY_EVENT_BUFFER_SIZE = 512 + }; + + struct KeyEvent { + unsigned int osx_state; + bool pressed; + bool echo; + uint32_t scancode; + uint32_t unicode; + }; + + KeyEvent key_event_buffer[KEY_EVENT_BUFFER_SIZE]; + int key_event_pos; + bool force_quit; // rasterizer seems to no longer be given to visual server, its using GLES3 directly? //Rasterizer *rasterizer; @@ -72,6 +87,7 @@ public: CGEventSourceRef eventSource; void process_events(); + void process_key_events(); void *framework; // pthread_key_t current; |