Author Topic: How can I assign custom shortcuts using the Python Console?  (Read 735 times)

Hi,

I'd like to have my own shortcuts when working in Painter (besides the ones already available in the Settings, Shortcuts). For instance, I'd like to assign a hotkey to 'Add Black Mask'.
How can I go about doing this?

Thx!


Last Edit: March 12, 2021, 03:25:20 pm

I used Pyside shortcut function in Painter. You could try it.
But you have to avoid current Default key short
Last Edit: March 23, 2021, 06:27:29 am

Interesting, but do you have any Python sample code to explain how you are doing?

Thanks,

Maelvon

self.btn = QtWidgets.QPushButton('Button01')
self.btn.setShortcut('a')
Hope it could be helpful, One thing you have to do is you need to keep this button's panel stay at the screen, do not to remove it or minimize it into the dock.
Last Edit: April 19, 2021, 09:51:27 am