Forum: Poser Python Scripting


Subject: assign a keyboard shortcut to a script

sergio777 opened this issue on Apr 12, 2021 ยท 4 posts


sergio777 posted Mon, 12 April 2021 at 11:53 AM

Hi folks, is there any way to assign a keyboard shortcut to a specific script? Thanks in advance.


HartyBart posted Wed, 14 April 2021 at 6:22 AM

In terms of having something in Poser allow the call of a script by a key-press, so far as I know.... that's not possible.

But one option would be to do it with a general Windows macro recorder/player such as the $40 JitBit. Record the launch of the script to a macro, set a keyboard hotkey for it to playback.

You can also have a script be a persistent one-click icon on a floating panel, which may be sufficient for you. The $10 XA Toolbar + AVFix is what you want there. They can both be configured to launch along with Poser 11. I've no idea if it XA Toolbar works yet on Poser 12, though. You can't assign hotkeys via XA Toolbar, at least so far as I know.



Learn the Secrets of Poser 11 and Line-art Filters.


adp001 posted Fri, 23 April 2021 at 8:48 AM

I'm a bit late with this, but maybe someone wants to play with it:

def my_script():
    print("My script started because F1 was pressed.")


def new_handler(event):
    keycode = event.GetKeyCode()
    if keycode == wx.WXK_F1:
        my_script()
    event.Skip()


root = poser.WxApp()
root.Bind(wx.EVT_KEY_DOWN, new_handler)

Run the script and press "F1".

Note: You have to unbind the function before you activate it a second time! If you do not, the first installed eventhandler stays active until you close Poser.




adp001 posted Fri, 23 April 2021 at 9:12 AM

By the way: The script shown above is a good example of why you should not enter passwords in Poser. E.g. for downloads by Bondware/Renderosity. Every Python script is able to read what a user is typing. Especially dangerous with "compiled" scripts.