ID 369511 - Keyboard Shortcut assignment does not respect correct context and won't assign a shortcut if it already exists

Follow

Problem summary:

When assigning a keyboard shortcut in Katana. If a shortcut already exists, a new shortcut of the same key will not be assigned. The assignment should only fail if the key would be in conflict in the same context.

Steps to reproduce:

  1. Create a ~/.katana/init.py file with the following content:
    1. 
      from UI4.App.KeyboardShortcutManager import KeyboardShortcutManagerclass DummyTestPanel(object):    def actionCallback(self):        print('Action Callback')KeyboardShortcutManager.RegisterAction('50d4d5c1d7704d44bf9f0f3b54c36969',                                       'Dummy Test Panel.Action1',                                       'Ctrl+L',                                       DummyTestPanel.actionCallback)KeyboardShortcutManager.RegisterAction('4c9583cbc93f4de982dbd9cc1aa47fd1',                                       'Dummy Test Panel.Action2',                                       'Ctrl+L',                                       DummyTestPanel.actionCallback)KeyboardShortcutManager.RegisterAction('53cbc93f4de982dbd9cc7dff12336969',                                       'Another Test Panel.Action',                                       'Ctrl+L',                                       DummyTestPanel.actionCallback)
  2. Run Katana

Expected behaviour:

Now the 3rd action will be registered, as it has a different context. We still get the warning for the 2nd action:


[WARN python.KeyboardShortcutManager]: RegisterAction(): Unable to register action with ID "4c9583cbc93f4de982dbd9cc1aa47fd1" and name "Dummy Test Panel.Action2": Shortcut "Ctrl+L" has already been used for "Dummy Test Panel.Action1". Shortcut will not be assigned.

Actual behaviour:

The 2nd and 3rd actions won't be registered, and a warning will be printed for both of them:


[WARN python.KeyboardShortcutManager]: RegisterAction(): Unable to register action with ID "4c9583cbc93f4de982dbd9cc1aa47fd1" and name "Dummy Test Panel.Action2": Shortcut "Ctrl+L" has already been used for "Dummy Test Panel.Action1". Shortcut will not be assigned.[WARN python.KeyboardShortcutManager]: RegisterAction(): Unable to register action with ID "53cbc93f4de982dbd9cc7dff12336969" and name "Another Test Panel.Action": Shortcut "Ctrl+L" has already been used for "Dummy Test Panel.Action1". Shortcut will not be assigned.

Workaround:

No known workaround.

Tested versions/platforms:

  • 3.0v3 - Unaffected
  • 3.0v4  - Affected
  • 3.0v5 - Affected

Customer version/platform:

Not supplied

    We're sorry to hear that

    Please tell us why