Describe the bug
When the BTT Esc button is pressed, the running application is not getting Key Down and Key Up events for the ESC button. Most games check only Key Down and Key Up events and ignore Key Press events. Also sending KeyBoard shortcuts also doesn't send Key Down and Key Up events. (Of course this could be require adding a slider for how long the key should be held down for before the key up is pressed for keyboard shortcuts)
Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):
Touch Bar
(More of an Output problem than input, all devices are effected if they send keyboard shortcuts.)
Device information:
- Type of Mac: MacBook Pro (15-inch, 2016)
- macOS version: 10.14.5 (18F132)
- BetterTouchTool version: 3.167 (1340)
Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):
The following Apple Script sends Key Down and Key Up codes that have worked in games i have tried.
Games I have verified BTT shortcuts not working in that need this:
Minecraft, Terraria, Binding of Isaac.
This Code i set up for the Esc Key to trigger to make the escape key work in the game Binding of Isaac. without it the game is non-functioning without disabling the Touch Bar. Other Games seem to need the same events to function properly. Although I could put in this script and have for many games for each key i need, The Esc key problem still exists and it's a lot of extra work that your tool could handle much better if it sent the Key Up/Down events.
ObjC.import("Cocoa");
function key(aiKeyCode, aiDelay)
{
var source = $.CGEventSourceCreate($.kCGEventSourceStateCombinedSessionState),
keyDown = $.CGEventCreateKeyboardEvent(source, aiKeyCode, true),
keyUp = $.CGEventCreateKeyboardEvent(source, aiKeyCode, false);
$.CGEventPost($.kCGAnnotatedSessionEventTap, keyDown);
delay(aiDelay);
$.CGEventPost($.kCGAnnotatedSessionEventTap, keyUp);
}
key(53,0.02)