On 28/03/2017 at 10:08, xxxxxxxx wrote:
I'm using this code to essentially set the enter key equal to hitting the "search" button on my plugin but it runs twice when I hit enter for some reason which screws things up.
[Update] I found that if just the plugin window is selected when I press "enter" it only runs once, but if the the edit text field in the plugin is highlighted(waiting for user to type) it runs twice? It's like its running once for the edit text field and once for the plugin itself.
bc = c4d.BaseContainer()
if c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.KEY_ENTER,bc):
if bc[c4d.BFM_INPUT_VALUE] == 1:
id = UI_SEARCH