Blender  V2.93
GHOST_EventKey.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
25 #pragma once
26 
27 #include <string.h>
28 
29 #include "GHOST_Event.h"
30 
34 class GHOST_EventKey : public GHOST_Event {
35  public:
44  GHOST_IWindow *window,
45  GHOST_TKey key,
46  bool is_repeat)
47  : GHOST_Event(msec, type, window)
48  {
49  m_keyEventData.key = key;
50  m_keyEventData.ascii = '\0';
51  m_keyEventData.utf8_buf[0] = '\0';
52  m_keyEventData.is_repeat = is_repeat;
54  }
55 
65  GHOST_IWindow *window,
66  GHOST_TKey key,
67  char ascii,
68  const char utf8_buf[6],
69  bool is_repeat)
70  : GHOST_Event(msec, type, window)
71  {
72  m_keyEventData.key = key;
73  m_keyEventData.ascii = ascii;
74  if (utf8_buf)
75  memcpy(m_keyEventData.utf8_buf, utf8_buf, sizeof(m_keyEventData.utf8_buf));
76  else
77  m_keyEventData.utf8_buf[0] = '\0';
78  m_keyEventData.is_repeat = is_repeat;
80  }
81 
82  protected:
85 };
unsigned long long GHOST_TUns64
Definition: GHOST_Types.h:86
GHOST_TEventType
Definition: GHOST_Types.h:177
GHOST_TKey
Definition: GHOST_Types.h:267
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
GHOST_TEventKeyData m_keyEventData
GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow *window, GHOST_TKey key, bool is_repeat)
GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow *window, GHOST_TKey key, char ascii, const char utf8_buf[6], bool is_repeat)
GHOST_TEventDataPtr m_data
Definition: GHOST_Event.h:90