Free Electron
NativeKeyboard.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __native_NativeKeyboard_h__
8 #define __native_NativeKeyboard_h__
9 
10 #if FE_2DGL==FE_2D_X_GFX
11 
12 #include "window/WindowEvent.h"
13 
14 namespace fe
15 {
16 namespace ext
17 {
18 
19 /**************************************************************************//**
20  @brief WindowEvent handler that watches for a poll event and then
21  feeds back any accumulated keyboard events
22 
23  @ingroup native
24 *//***************************************************************************/
25 class FE_DL_EXPORT NativeKeyboard:
26  virtual public KeyI,
27  public Initialize<NativeKeyboard>
28 {
29  public:
30  NativeKeyboard(void);
31 virtual ~NativeKeyboard(void);
32 
33  void initialize(void);
34 
35  //* As HandlerI
36 virtual void handleBind(sp<SignalerI> spSignalerI, sp<Layout> spLayout);
37 virtual void handle(Record &record);
38 
39 virtual BWORD generatesReleaseEvents(void) { return TRUE; }
40 
41  private:
42 
43  void poll(void);
44 
45  Display* m_pDisplay;
46  Window m_rootWindow;
47  I32 m_xi_opcode;
48 
49  XIEventMask m_eventMask[2];
50 
51  hp<SignalerI> m_hpSignalerI;
52 
53  WindowEvent m_event;
54  WindowEvent m_keyEvent;
55  Record m_keyRecord;
56 
57  I32 m_maxButtons;
58  Array<I32> m_pButtonState;
59 
60  BWORD m_shift;
61  BWORD m_control;
62  BWORD m_alt;
63  BWORD m_capsLock;
64 };
65 
66 } /* namespace ext */
67 } /* namespace fe */
68 
69 #endif
70 
71 #endif /* __native_NativeKeyboard_h__ */
Keyboard event generator.
Definition: KeyI.h:20
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
WindowEvent handler that watches for a poll event and then feeds back any accumulated keyboard events...
Definition: NativeKeyboard.h:25
Generalized windowing event.
Definition: WindowEvent.h:43
Reference to an instance of a Layout.
Definition: RecordSB.h:35