Keyboard input

This commit is contained in:
elasota
2019-12-25 22:20:10 -05:00
parent 5cb9b85396
commit ac3929fb1f
34 changed files with 1003 additions and 708 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <stdint.h>
namespace GpKeyModifiers
{
enum GpKeyModifier
@@ -14,11 +16,12 @@ namespace GpKeyIDSubsets
enum GpKeyIDSubset
{
kASCII,
kUnicode,
kSpecial,
kNumPadASCII,
kNumPadNumber,
kNumPadSpecial,
kFKey, // Key value is a raw F number
};
};
}
typedef GpKeyIDSubsets::GpKeyIDSubset GpKeyIDSubset_t;
@@ -27,6 +30,7 @@ namespace GpKeySpecials
{
enum GpKeySpecial
{
kTab,
kEscape,
kPrintScreen,
kScrollLock,
@@ -47,11 +51,33 @@ namespace GpKeySpecials
kLeftAlt,
kRightAlt,
kNumLock,
kLeftArrow,
kUpArrow,
kDownArrow,
kRightArrow,
kCount,
};
}
typedef GpKeySpecials::GpKeySpecial GpKeySpecial_t;
namespace GpNumPadSpecials
{
enum GpNumPadSpecial
{
kSlash,
kAsterisk,
kMinus,
kPlus,
kCount,
};
}
typedef GpNumPadSpecials::GpNumPadSpecial GpNumPadSpecial_t;
namespace GpKeyboardInputEventTypes
{
enum GpKeyboardInputEventType
@@ -68,8 +94,12 @@ struct GpKeyboardInputEvent
{
union KeyUnion
{
GpKeySpecials::GpKeySpecial m_specialKey;
GpKeySpecial_t m_specialKey;
GpNumPadSpecial_t m_numPadSpecialKey;
uint8_t m_numPadNumber;
char m_asciiChar;
uint32_t m_unicodeChar;
unsigned char m_fKey;
};
GpKeyboardInputEventType_t m_eventType;
@@ -135,3 +165,5 @@ struct GpVOSEvent
EventUnion m_event;
GpVOSEventType_t m_eventType;
};
static const unsigned int GpFKeyMaximumInclusive = 24;