FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
KeyboardEvents.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: April 2, 2010
5 License: Dual license model; choose one of two:
6 New BSD License
7 http://www.opensource.org/licenses/bsd-license.php
8 - or -
9 GNU Lesser General Public License, version 2.1
10 http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2010 Richard Bateman, Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_FB_PLUGINEVENTS_KEYBOARDEVENTS
17 #define H_FB_PLUGINEVENTS_KEYBOARDEVENTS
18 
19 #include "PluginEvent.h"
20 #include "KeyCodes.h"
21 
22 namespace FB {
23 
29  class KeyEvent : public PluginEvent
30  {
31  public:
32  KeyEvent(FBKeyCode fb_key, uint32_t os_key, uint32_t modifiers = 0)
33  :
34  m_key_code( fb_key ), m_os_key_code( os_key ), m_modifierFlags(modifiers)
35  { }
36 
37  public:
38  FBKeyCode m_key_code;
39  uint32_t m_os_key_code;
40  uint32_t m_modifierFlags;
41  };
42 
48  class KeyUpEvent : public KeyEvent
49  {
50  public:
51  KeyUpEvent(FBKeyCode fb_key, uint32_t os_key, uint32_t modifiers = 0)
52  : KeyEvent(fb_key, os_key, modifiers) {}
53  };
54 
60  class KeyDownEvent : public KeyEvent
61  {
62  public:
63  KeyDownEvent(FBKeyCode fb_key, uint32_t os_key, uint32_t modifiers = 0)
64  : KeyEvent(fb_key, os_key, modifiers) {}
65  };
66 
72  class TextEvent : public PluginEvent
73  {
74  public:
75  TextEvent(const std::string& text) : text(text) {}
76 
77  public:
78  std::string text;
79  };
80 
81 
82 };
83 
84 #endif // H_FB_PLUGINEVENTS_KEYBOARDEVENTS
85 
Fired for a key down event.
Fired for a key up event.
FBKeyCode
Values that represent different keys in a platform agnostic way.
Definition: KeyCodes.h:26
Used at least on Mac, possibly elsewhere; gives us text.
Fired for a key event.
Plugin event base class.
Definition: PluginEvent.h:36