CommonLibSSE (powerof3)
GFxKeyboardState.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/G/GFxEvent.h"
4 #include "RE/G/GFxKey.h"
5 #include "RE/G/GFxPlayerStats.h"
8 
9 namespace RE
10 {
11  class GASStringContext;
12 
13  class GFxKeyboardState : public GRefCountBaseNTS<GFxKeyboardState, GFxStatMovieViews::kGFxStatMV_Other_Mem>
14  {
15  public:
16  class IListener
17  {
18  public:
19  virtual ~IListener() = default; // 00
20 
21  // add
22  virtual void OnKeyDown(GASStringContext* a_sc, int a_code, std::uint8_t a_ascii, std::uint32_t a_charCode, std::uint8_t a_keyboardIndex) = 0; // 01
23  virtual void OnKeyUp(GASStringContext* a_sc, int a_code, std::uint8_t a_ascii, std::uint32_t a_charCode, std::uint8_t a_keyboardIndex) = 0; // 02
24  virtual void Update(int a_code, std::uint8_t a_ascii, std::uint32_t a_charCode, std::uint8_t a_keyboardIndex) = 0; // 03
25  };
26  static_assert(sizeof(IListener) == 0x8);
27 
28  class KeyQueue
29  {
30  public:
31  enum
32  {
33  kKeyQueueSize = 100
34  };
35 
36  struct KeyRecord
37  {
38  std::uint32_t charCode; // 00
39  std::uint16_t code; // 04
40  std::uint16_t pad06; // 06
42  std::uint8_t ascii; // 0C
44  std::uint8_t pad0E; // 0E
45  std::uint8_t pad0F; // 0F
46  };
47  static_assert(sizeof(KeyRecord) == 0x10);
48 
49  // members
51  std::uint32_t putIdx; // 640
52  std::uint32_t getIdx; // 644
53  std::uint32_t count; // 648
54  };
55  static_assert(sizeof(KeyQueue) == 0x64C);
56 
57  // members
60  std::uint8_t keyboardIndex; // 664
61  std::uint8_t keymap[GFxKey::kTotal / 8 + 1]; // 665
62  bool toggled[3]; // 682
63  std::uint8_t pad685; // 685
64  std::uint8_t pad686; // 686
65  std::uint8_t pad687; // 687
66  };
67  static_assert(sizeof(GFxKeyboardState) == 0x688);
68 }
EventType
Definition: GFxEvent.h:12
@ kTotal
Definition: GFxKey.h:128
Definition: GFxKeyboardState.h:17
virtual void OnKeyUp(GASStringContext *a_sc, int a_code, std::uint8_t a_ascii, std::uint32_t a_charCode, std::uint8_t a_keyboardIndex)=0
virtual void OnKeyDown(GASStringContext *a_sc, int a_code, std::uint8_t a_ascii, std::uint32_t a_charCode, std::uint8_t a_keyboardIndex)=0
virtual void Update(int a_code, std::uint8_t a_ascii, std::uint32_t a_charCode, std::uint8_t a_keyboardIndex)=0
Definition: GFxKeyboardState.h:29
std::uint32_t putIdx
Definition: GFxKeyboardState.h:51
std::uint32_t getIdx
Definition: GFxKeyboardState.h:52
@ kKeyQueueSize
Definition: GFxKeyboardState.h:33
KeyRecord buffer[kKeyQueueSize]
Definition: GFxKeyboardState.h:47
std::uint32_t count
Definition: GFxKeyboardState.h:53
Definition: GFxKeyboardState.h:14
std::uint8_t keyboardIndex
Definition: GFxKeyboardState.h:60
IListener * listener
Definition: GFxKeyboardState.h:55
KeyQueue keyQueue
Definition: GFxKeyboardState.h:59
bool toggled[3]
Definition: GFxKeyboardState.h:62
std::uint8_t keymap[GFxKey::kTotal/8+1]
Definition: GFxKeyboardState.h:61
std::uint8_t pad685
Definition: GFxKeyboardState.h:63
std::uint8_t pad687
Definition: GFxKeyboardState.h:65
std::uint8_t pad686
Definition: GFxKeyboardState.h:64
Definition: GFxSpecialKeysState.h:6
Definition: GRefCountBaseNTS.h:10
Definition: AbsorbEffect.h:6
Definition: GFxKeyboardState.h:37
std::uint32_t charCode
Definition: GFxKeyboardState.h:38
GFxEvent::EventType event
Definition: GFxKeyboardState.h:41
GFxSpecialKeysState specialKeysState
Definition: GFxKeyboardState.h:43
std::uint8_t pad0E
Definition: GFxKeyboardState.h:44
std::uint8_t ascii
Definition: GFxKeyboardState.h:42
std::uint16_t pad06
Definition: GFxKeyboardState.h:40
std::uint16_t code
Definition: GFxKeyboardState.h:39
std::uint8_t pad0F
Definition: GFxKeyboardState.h:45