Houdini 20.0 Python scripting hou hou.qt

hou.qt.qtKeyEventToString HOM function

Converts a Qt key event into a string that is suitable for UI display or to pass to the hot key manager.

qtKeyEventToString(qtkeyevent) str

This is an extended version of hou.qt.qtKeyToString() that uses the available extended key event info maintained by Houdini to ignore the effect of modifiers on the event key and text.

The result is a more convenient way of doing:

extended_info = hou.qt.extendedKeyEventInfo(event);
if extended_info is not None:
    key = extended_info['unmodified_key']
    text = extended_info['unmodified_text']
    key = event.key()
    text = event.text()

    hou.qt.qtKeyToString(key, event.modifiers(), text)