KeyboardManagerEditor.h
1 #pragma once 2 3 #include <keyboardmanager/common/Input.h> 4 #include <keyboardmanager/common/MappingConfiguration.h> 5 6 #include <KeyboardManagerState.h> 7 8 enum class KeyboardManagerEditorType 9 { 10 KeyEditor = 0, 11 ShortcutEditor, 12 }; 13 14 class KeyboardManagerEditor 15 { 16 public: 17 KeyboardManagerEditor(HINSTANCE hInstance); 18 ~KeyboardManagerEditor(); 19 20 KeyboardManagerInput::Input& GetInputHandler() noexcept 21 { 22 return inputHandler; 23 } 24 25 bool StartLowLevelKeyboardHook(); 26 void OpenEditorWindow(KeyboardManagerEditorType type, std::wstring keysForShortcutToEdit, std::wstring action); 27 28 // Function called by the hook procedure to handle the events. This is the starting point function for remapping 29 intptr_t HandleKeyboardHookEvent(LowlevelKeyboardEvent* data) noexcept; 30 31 private: 32 static LRESULT CALLBACK KeyHookProc(int nCode, WPARAM wParam, LPARAM lParam); 33 34 inline static HHOOK hook; 35 HINSTANCE hInstance; 36 37 KBMEditor::KeyboardManagerState keyboardManagerState; 38 MappingConfiguration mappingConfiguration; 39 40 // Object of class which implements InputInterface. Required for calling library functions while enabling testing 41 KeyboardManagerInput::Input inputHandler; 42 };