Sending multiple keyboard shortcuts through single action

Describe the bug
Hey again! There's quite a few things that I'll report once I get little bit more time, but for now this seems like a biggest blocker for me:

I want to execute multiple kbd shortcuts after using one. So for example, I save something in VSCode and I want it to indeed save + do some other stuff.

So I've tried doing that using Send keyboard shortcut (generic) and Send keyboard shortcut to application. Both does not seem to work, plus BTT restarts after such action.

Here's a JSON for that action:

[
  {
    "BTTTriggerType" : 0,
    "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
    "BTTPredefinedActionType" : -1,
    "BTTPredefinedActionName" : "No Action",
    "BTTLayoutIndependentActionChar" : "s",
    "BTTAutoAdaptActionToKeyboardLayout" : true,
    "BTTShortcutToSend" : "55,1",
    "BTTAdditionalConfiguration" : "1048584",
    "BTTEnabled2" : 1,
    "BTTKeyboardShortcutKeyboardType" : 4281,
    "BTTRepeatDelay" : 0,
    "BTTUUID" : "ABF290D9-879C-4DCF-A9E7-14E283797980",
    "BTTTriggerOnDown" : 1,
    "BTTNotesInsteadOfDescription" : 0,
    "BTTLayoutIndependentChar" : "s",
    "BTTEnabled" : 1,
    "BTTModifierMode" : 0,
    "BTTShortcutKeyCode" : 1,
    "BTTShortcutModifierKeys" : 1048576,
    "BTTOrder" : 1,
    "BTTDisplayOrder" : 0,
    "BTTAutoAdaptToKeyboardLayout" : 0,
    "BTTAdditionalActions" : [
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 129,
        "BTTPredefinedActionName" : "Delay Next Action",
        "BTTDelayNextActionBy" : "1",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "3B0311EC-BB96-4EC5-9112-E30C5781BE73",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 705,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : -1,
        "BTTPredefinedActionName" : "No Action",
        "BTTLayoutIndependentActionChar" : "p",
        "BTTAutoAdaptActionToKeyboardLayout" : true,
        "BTTShortcutToSend" : "56,55,35",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "03498570-8F28-469C-9AAE-F555C4DCBB3C",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 706,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 129,
        "BTTPredefinedActionName" : "Delay Next Action",
        "BTTDelayNextActionBy" : "1",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "CFA85EF1-8280-428E-A73B-3B6CDF45F205",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 707,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : -1,
        "BTTPredefinedActionName" : "No Action",
        "BTTLayoutIndependentActionChar" : "i",
        "BTTAutoAdaptActionToKeyboardLayout" : true,
        "BTTShortcutToSend" : "34",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "4BED563D-F86D-4E90-9D6C-5AFEE65C0092",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 708,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      }
    ]
  }
]

And alternative:

[
  {
    "BTTTriggerType" : 0,
    "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
    "BTTPredefinedActionType" : 128,
    "BTTPredefinedActionName" : "Send Shortcut to Specific App",
    "BTTLayoutIndependentActionChar" : "file:\/\/\/Applications\/Visual%20Studio%20Code.app",
    "BTTAutoAdaptActionToKeyboardLayout" : true,
    "BTTShortcutApp" : "file:\/\/\/Applications\/Visual%20Studio%20Code.app",
    "BTTShortcutAppUnderCursor" : "com.microsoft.VSCode",
    "BTTShortcutToSend" : "55,1",
    "BTTAdditionalConfiguration" : "1048584",
    "BTTEnabled2" : 1,
    "BTTKeyboardShortcutKeyboardType" : 4281,
    "BTTRepeatDelay" : 0,
    "BTTUUID" : "2A611511-0A90-4C26-B8BE-A25D44B1EE8B",
    "BTTTriggerOnDown" : 1,
    "BTTNotesInsteadOfDescription" : 0,
    "BTTLayoutIndependentChar" : "s",
    "BTTEnabled" : 0,
    "BTTModifierMode" : 0,
    "BTTShortcutKeyCode" : 1,
    "BTTShortcutModifierKeys" : 1048576,
    "BTTOrder" : 0,
    "BTTDisplayOrder" : 0,
    "BTTAutoAdaptToKeyboardLayout" : 0,
    "BTTAdditionalActions" : [
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 129,
        "BTTPredefinedActionName" : "Delay Next Action",
        "BTTDelayNextActionBy" : "1",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "8006355A-8710-4833-AA79-51CF7BACEF7F",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 0,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : 0,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 128,
        "BTTPredefinedActionName" : "Send Shortcut to Specific App",
        "BTTLayoutIndependentActionChar" : "file:\/\/\/Applications\/Visual%20Studio%20Code.app",
        "BTTAutoAdaptActionToKeyboardLayout" : true,
        "BTTShortcutApp" : "file:\/\/\/Applications\/Visual%20Studio%20Code.app",
        "BTTShortcutAppUnderCursor" : "com.microsoft.VSCode",
        "BTTShortcutToSend" : "56,55,35",
        "BTTAdditionalConfiguration" : "1048584",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 4281,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "9A28F3C3-CDDE-4E42-AAE5-4D9AB4BD5B70",
        "BTTTriggerOnDown" : 1,
        "BTTNotesInsteadOfDescription" : 0,
        "BTTLayoutIndependentChar" : "s",
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : 1,
        "BTTShortcutModifierKeys" : 1048576,
        "BTTOrder" : 1,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 129,
        "BTTPredefinedActionName" : "Delay Next Action",
        "BTTDelayNextActionBy" : "1",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "F78CB175-1160-47F4-B82D-9ED1C31504EB",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 2,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      }
    ]
  }
]

I've tried both with delays and without them.

Screenshots

Device information:
Catalina 10.15.2 (19C57)
MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)
BTT 3.333

The most important thing for shortcuts that trigger themselves is to enable the "Prevent recursive triggers" checkbox:

However I think there is a bug with the delay option. I will have a look asap.

//edit: I think in general it should work. The delay issue I was seeing is specific to some special cases.

the delay issue should be fixed in 3.334

Cool! Testing it now. Not sure how delay issue was related to that, but I just noticed I wasn't too clear about what's the issue.

When i try to execute this action:

[
  {
    "BTTTriggerType" : 0,
    "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
    "BTTPredefinedActionType" : -1,
    "BTTPredefinedActionName" : "No Action",
    "BTTLayoutIndependentActionChar" : "s",
    "BTTAutoAdaptActionToKeyboardLayout" : true,
    "BTTShortcutToSend" : "55,1",
    "BTTAdditionalConfiguration" : "1048584",
    "BTTEnabled2" : 1,
    "BTTKeyboardShortcutKeyboardType" : 4281,
    "BTTRepeatDelay" : 0,
    "BTTUUID" : "ABF290D9-879C-4DCF-A9E7-14E283797980",
    "BTTTriggerOnDown" : 1,
    "BTTNotesInsteadOfDescription" : 0,
    "BTTLayoutIndependentChar" : "s",
    "BTTEnabled" : 1,
    "BTTModifierMode" : 0,
    "BTTShortcutKeyCode" : 1,
    "BTTShortcutModifierKeys" : 1048576,
    "BTTOrder" : 1,
    "BTTDisplayOrder" : 0,
    "BTTAutoAdaptToKeyboardLayout" : 0,
    "BTTAdditionalActions" : [
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 129,
        "BTTPredefinedActionName" : "Delay Next Action",
        "BTTDelayNextActionBy" : "1",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "3B0311EC-BB96-4EC5-9112-E30C5781BE73",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 705,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : -1,
        "BTTPredefinedActionName" : "No Action",
        "BTTLayoutIndependentActionChar" : "p",
        "BTTAutoAdaptActionToKeyboardLayout" : true,
        "BTTShortcutToSend" : "56,55,35",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "03498570-8F28-469C-9AAE-F555C4DCBB3C",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 706,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 129,
        "BTTPredefinedActionName" : "Delay Next Action",
        "BTTDelayNextActionBy" : "1",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "CFA85EF1-8280-428E-A73B-3B6CDF45F205",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 707,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      },
      {
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : -1,
        "BTTPredefinedActionName" : "No Action",
        "BTTLayoutIndependentActionChar" : "i",
        "BTTAutoAdaptActionToKeyboardLayout" : true,
        "BTTShortcutToSend" : "34",
        "BTTEnabled2" : 1,
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTRepeatDelay" : 0,
        "BTTUUID" : "4BED563D-F86D-4E90-9D6C-5AFEE65C0092",
        "BTTNotesInsteadOfDescription" : 0,
        "BTTEnabled" : 1,
        "BTTModifierMode" : 0,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 708,
        "BTTDisplayOrder" : 0,
        "BTTAutoAdaptToKeyboardLayout" : 0
      }
    ]
  }
]

I get something like this - shouldn't those two be triggered instead of showing a menu to choose an action from? I basically want to save a file in VSC and then do something more (execute another shortcut)

That doen't seem to happen here. Do you maybe have a duplicate cmd+s shortcut configured? (These menus shows when a given trigger appears more than once).

Does it still happen in 3.334?

The JSON you pasted also doesn't have a "Send shortcut to specific application" item as far as I can see. The "send shift+cmd+p to visual studio code" seems to come from somewhere else.

Sorry, maybe I copied the wrong one...
It still happens in 3.334 - I mean, I still cannot send any shortcut to VSC (maybe it's app specific issue? hard to tell).

I think there's an issue with enabling/disabling the shortcut. Will provide a recording in a minute

So what's happening here imo:

  1. The VSCode specific actions are recognised properly, as the button appears on the touch bar
  2. I think the "shortuct enabled" checkbox does not work - actions seem to be taken into account even if it's is ticked off
  3. The shortcut is not sent to VSCode after all, I did not manage to invoke the vscode prompt menu programatically :thinking:
  4. The HUD did not appear even once though, and it was present in both actions

Weird, I can't seem to reproduce any of these :slight_smile:
The JSON you originally posted opens the vscode prompt menu and enters "i" on my machine.

Could you maybe post or send an export of your full preset? (andreas@folivora.ai)

However one note: on Catalina the "Send Shortcut to specific app" only works on few apps out of the box. For most it requires to check the "Bring app to fron" and "Switch back immediately". In your case a ordinary send shortcut should work though, no need to send it to a specific app, or do I miss something? This is only necessary if some other app was active, but if you are already in vscode it shouldn't matter.

Yeah I've checked them all just to be safe in advance (Bring app to front, Switch back immediately).

Yes, it shouldn't be necessary as this is the same app. I'm not sure what might be the case really. I've sent you my fullpresent, it grew a bit over the years so it's not cleanest, maybe something collides there...

Again, the only thing I wanted to do is;

  • invoke a shortcut (eg. cmd + s)
  • propagate it (so vsc catches cmd + s)
  • do something more - for example, open the menu in vsc with cmd + shift + p

Maybe it's VSCode, or my preset... Hard to tell really, anyway thank you for your dedication :v:

Fixed with 3.335 - thanks Andreas!