0
$\begingroup$

How to capture a single key user input in the UI panel of the add-on?

The UILayout documentation mentions an event parameter in the prop method. If this is set to True, there appears a single key input control in the UI Panel. But I am unable to capture the key pressed on this control.

Would appreciate any help.

$\endgroup$

1 Answer 1

0
$\begingroup$

To capture a single key, the event param of prop in UILayout needs to be set to True and the corresponding property needs to be an EnumProperty with ALL the key codes mapped.

When the user presses a key on the control, the EnumProperty item that is related to the code of the key pressed, gets selected.

Please post your answer if you have any better alternative.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .