2020-05-29 05:47:32 +08:00
# pragma once
2020-07-14 02:49:09 +08:00
# include <map>
# include <mutex>
# include "keyboardmanager/common/KeyboardManagerConstants.h"
2020-07-31 19:06:13 +08:00
# include <common/LowlevelKeyboardEvent.h>
2020-07-14 02:49:09 +08:00
class InputInterface ;
class KeyboardManagerState ;
class Shortcut ;
class RemapShortcut ;
2020-05-29 05:47:32 +08:00
namespace KeyboardEventHandlers
{
// Function to a handle a single key remap
2020-06-12 04:07:46 +08:00
__declspec ( dllexport ) intptr_t HandleSingleKeyRemapEvent ( InputInterface & ii , LowlevelKeyboardEvent * data , KeyboardManagerState & keyboardManagerState ) noexcept ;
2020-05-29 05:47:32 +08:00
// Function to a change a key's behavior from toggle to modifier
2020-06-12 04:07:46 +08:00
__declspec ( dllexport ) intptr_t HandleSingleKeyToggleToModEvent ( InputInterface & ii , LowlevelKeyboardEvent * data , KeyboardManagerState & keyboardManagerState ) noexcept ;
2020-05-29 05:47:32 +08:00
// Function to a handle a shortcut remap
2020-07-24 07:43:49 +08:00
__declspec ( dllexport ) intptr_t HandleShortcutRemapEvent ( InputInterface & ii , LowlevelKeyboardEvent * data , std : : map < Shortcut , RemapShortcut > & reMap , std : : vector < Shortcut > & sortedReMapKeys , std : : mutex & map_mutex , KeyboardManagerState & keyboardManagerState , const std : : wstring & activatedApp = KeyboardManagerConstants : : NoActivatedApp ) noexcept ;
2020-05-29 05:47:32 +08:00
// Function to a handle an os-level shortcut remap
2020-06-12 04:07:46 +08:00
__declspec ( dllexport ) intptr_t HandleOSLevelShortcutRemapEvent ( InputInterface & ii , LowlevelKeyboardEvent * data , KeyboardManagerState & keyboardManagerState ) noexcept ;
2020-05-29 05:47:32 +08:00
// Function to a handle an app-specific shortcut remap
2020-06-12 04:07:46 +08:00
__declspec ( dllexport ) intptr_t HandleAppSpecificShortcutRemapEvent ( InputInterface & ii , LowlevelKeyboardEvent * data , KeyboardManagerState & keyboardManagerState ) noexcept ;
2020-06-06 03:54:52 +08:00
// Function to ensure Num Lock state does not change when it is suppressed by the low level hook
2020-06-12 04:07:46 +08:00
void SetNumLockToPreviousState ( InputInterface & ii ) ;
2020-06-16 07:48:00 +08:00
2020-07-24 07:43:49 +08:00
// Function to ensure Ctrl/Shift/Alt modifier key state is not detected as pressed down by applications which detect keys at a lower level than hooks when it is remapped for scenarios where its required
void ResetIfModifierKeyForLowerLevelKeyHandlers ( InputInterface & ii , DWORD key , DWORD target ) ;
2020-05-29 05:47:32 +08:00
} ;