mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Add in missing telemetry for Keyboard Manager usage (#6393)
* Added key remap invoked telemetry event * Added queryperformance call * Added in telemetry for key and shortcut remaps * Removed redundant if check
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <keyboardmanager/common/KeyboardManagerState.h>
|
||||
#include <keyboardmanager/common/InputInterface.h>
|
||||
#include <keyboardmanager/common/Helpers.h>
|
||||
#include <keyboardmanager/common/trace.h>
|
||||
|
||||
namespace KeyboardEventHandlers
|
||||
{
|
||||
@@ -98,9 +99,12 @@ namespace KeyboardEventHandlers
|
||||
UINT res = ii.SendVirtualInput(key_count, keyEventList, sizeof(INPUT));
|
||||
delete[] keyEventList;
|
||||
|
||||
// If Caps Lock is being remapped to Ctrl/Alt/Shift, then reset the modifier key state to fix issues in certain IME keyboards where the IME shortcut gets invoked since it detects that the modifier and Caps Lock is pressed even though it is suppressed by the hook - More information at the GitHub issue https://github.com/microsoft/PowerToys/issues/3397
|
||||
if (data->wParam == WM_KEYDOWN || data->wParam == WM_SYSKEYDOWN)
|
||||
{
|
||||
// Log telemetry event when the key remap is invoked
|
||||
Trace::KeyRemapInvoked(remapToKey);
|
||||
|
||||
// If Caps Lock is being remapped to Ctrl/Alt/Shift, then reset the modifier key state to fix issues in certain IME keyboards where the IME shortcut gets invoked since it detects that the modifier and Caps Lock is pressed even though it is suppressed by the hook - More information at the GitHub issue https://github.com/microsoft/PowerToys/issues/3397
|
||||
if (remapToKey)
|
||||
{
|
||||
ResetIfModifierKeyForLowerLevelKeyHandlers(ii, target, it->first);
|
||||
@@ -311,6 +315,10 @@ namespace KeyboardEventHandlers
|
||||
lock.unlock();
|
||||
UINT res = ii.SendVirtualInput((UINT)key_count, keyEventList, sizeof(INPUT));
|
||||
delete[] keyEventList;
|
||||
|
||||
// Log telemetry event when shortcut remap is invoked
|
||||
Trace::ShortcutRemapInvoked(remapToShortcut, activatedApp != KeyboardManagerConstants::NoActivatedApp);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user