Generic Devices -> Try to get exclusive access to device, not working and no way to know why

When I check the Try to get exclusive access to device option, the analyzer stops seeing any input data,
I used to but have uninstalled Karabiner Elements which was used to control the device I am trying to use here, its a generic macropad with keys set as particular keypress combinations (Command+L to lock etc),
Is there a way I can know why exclusive access is not working currently via some shell script to solve the immediate issue and is this something that BTT can maybe show in future, I saw another discussion about this so wondering.

My usecase here is that for example,
I want Command + L on this macropad keyboard only to trigger Lock screen but only on this macropad,
I tried using Keyboard Shortcuts but that applies it to all keyboards even if I select only from same keyboard type (what does type mean here, is it the layout like US UK etc ?),
I tried using Key sequences and while that works with Recognize only on keyboard used for recording, it also inputs Command + L besides executing the assigned option which is a problem.
Generic devices seems like the best option but seems to not allow exclusive access and without it I am still getting the default action of that keypress (Command + L) happening.

TLDR: If there is a way for a keyboard shortcut to be detected only from a particular device then it will address my usecase perfectly.
Otherwise if Generic deviecs is the ideal use case here then is there a way to know why exclusive access isnt working.

Also, I just started using BTT and have to say this is amazing and I was surprised not only about how well it worked for the purpose I installed it originally for (More Trackpad gestures) but also how many other utilities it replaced so well. Great work!

I think, keyboards in general can not be "seized" by a particular app unless it works at a lower level. However you might not need "Generic Devices" for this. Maybe you can just record the keyboard shortcut and change the "Works on" setting:

Same type for me didn't work, it was possible to trigger assigned keyboard shortcut from other keyboard also,
what does type here mean exactly ?

BTT generates an ID that should be unique to the keyboard. However sometimes keyboards return the same value for serial number (or none at all), then this won't work.

//edit: you also need to re-record the shortcut if you enabled that checkbox later

I guess that is what is happening, in System Information I don't see any serial number either on the MacroPad or the Logitech Receiver, they do have different sets of VID and PID, maybe that can be used as fallback if serial number is not present to generate the ID

Mhm it's using the vendor id already, if the vendor ID is different for both, BTT should already be able to differentiate between them.

Could you record a shortcut with each keyboard, then select them in the BTT UI, press cmd+c to copy the configured trigger to your clipboard and paste the resulting JSON here?

[
  {
    "BTTLastUpdatedAt" : 1695726514.335717,
    "BTTTriggerType" : 0,
    "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
    "BTTPredefinedActionType" : 366,
    "BTTPredefinedActionName" : "Empty Placeholder",
    "BTTAdditionalConfiguration" : "1048584",
    "BTTKeyboardShortcutScope" : 1,
    "BTTKeyboardShortcutKeyboardType" : 2414,
    "BTTUUID" : "12E28C81-CD58-4893-B862-A44C3A3AEF6D",
    "BTTTriggerOnDown" : 1,
    "BTTLayoutIndependentChar" : "l",
    "BTTEnabled" : 1,
    "BTTEnabled2" : 1,
    "BTTShortcutKeyCode" : 37,
    "BTTShortcutModifierKeys" : 1048576,
    "BTTOrder" : 5,
    "BTTAutoAdaptToKeyboardLayout" : 0,
    "BTTAdditionalActions" : [
      {
        "BTTLastUpdatedAt" : 1695726469.6913829,
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 5,
        "BTTPredefinedActionName" : "Mission Control",
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTUUID" : "9EA6C006-8D5E-4CFC-A4DC-78145837EDFB",
        "BTTEnabled" : 1,
        "BTTEnabled2" : 1,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 112,
        "BTTAutoAdaptToKeyboardLayout" : 0
      }
    ],
    "BTTTriggerConfig" : {
      "BTTKeyboardShortcutScope" : 1
    }
  }
]
[
  {
    "BTTLastUpdatedAt" : 1695726525.890084,
    "BTTTriggerType" : 0,
    "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
    "BTTPredefinedActionType" : 366,
    "BTTPredefinedActionName" : "Empty Placeholder",
    "BTTAdditionalConfiguration" : "1048584",
    "BTTKeyboardShortcutScope" : 1,
    "BTTKeyboardShortcutKeyboardType" : 4489,
    "BTTUUID" : "21F7587F-F767-4702-B5AF-9F042005E779",
    "BTTTriggerOnDown" : 1,
    "BTTLayoutIndependentChar" : "l",
    "BTTEnabled" : 1,
    "BTTEnabled2" : 1,
    "BTTShortcutKeyCode" : 37,
    "BTTShortcutModifierKeys" : 1048576,
    "BTTOrder" : 6,
    "BTTAutoAdaptToKeyboardLayout" : 0,
    "BTTAdditionalActions" : [
      {
        "BTTLastUpdatedAt" : 1695726534.4789472,
        "BTTTriggerType" : -1,
        "BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
        "BTTPredefinedActionType" : 5,
        "BTTPredefinedActionName" : "Mission Control",
        "BTTKeyboardShortcutKeyboardType" : 0,
        "BTTUUID" : "9DE512BC-BEA7-4BA6-842D-BBD70FC76134",
        "BTTEnabled" : 1,
        "BTTEnabled2" : 1,
        "BTTShortcutKeyCode" : -1,
        "BTTShortcutModifierKeys" : -1,
        "BTTOrder" : 114,
        "BTTAutoAdaptToKeyboardLayout" : 0
      }
    ],
    "BTTTriggerConfig" : {
      "BTTKeyboardShortcutScope" : 1
    }
  }
]

First one is Logitech, second is the MacroPad

Weird - they show different keyboard types, so BTT should be able to differentiate between them. Are you sure it's still not working?

I changed one of the above two to Show Launchpad, and pressing Command+L made the menu show up with both actions,
removing the action from one of the two makes the other action happen on Command+L on both devices.
Does not look like its able to differentiate.

Very strange, maybe for some reason BTT can't get the lower level keyboard events necessary for this. Do you still have it configured in "Generic Devices"?

One other (unlikely) thing, make sure this checkbox is not enabled (the old one will not work with keyboard specific things):

I do have Always use old keyboard shortcut implementation enabled,
I had to enable it since without it any keyboard shortcuts defined in BTT and then when called from Logi Options+ were not triggering.

The latest alpha (4.274) should now also recognize the keyboard type when using the old keyboard shortcut implementation!

I will test it out, thanks @Andreas_Hegenberg , that was swift!
Although just an update, I got a good setup working for my MacroPad using Generic HID Device,
I could not prevent the default keyboard shortcut from triggering (so Command + L even when set to Lock screen still performs Command + L on whatever is the focused app).
Although by reprogramming the MacroPad to use certain obscure and not supported HID keycodes like Terminal Lock for Screen Lock for example, and then setting that HID key to perform screen lock, I can work around the issue and things are working great!
The original issue of exclusive access not working remains but I guess that can't be done as you had mentioned that getting exclusive access for keyboards is not possible without working at a lower level.