On 18/01/2015 at 05:51, xxxxxxxx wrote:
I try to get Keys within a dialog - with out success
def CreateLayout(self) :
self.SetTitle('Stage - Command Line')
self.GroupBegin(GROUP, c4d.BFH_SCALEFIT, cols=1, title="Generator",)
self.AddEditText(1001, c4d.BFH_SCALEFIT, editflags=c4d.EDITTEXT_HELPTEXT)
self.SetString(id = 1001,value = "enter a Stage command",flags = c4d.EDITTEXT_HELPTEXT)
self.GroupEnd()
return True
def Command(self, id_, msg) :
if id_ == 1001:
resultBaseContainer = c4d.BaseContainer()
self.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.KEY_ENTER,resultBaseContainer)
if resultBaseContainer[c4d.BFM_INPUT_VALUE]:
print self.GetString(1001)
bc = c4d.BaseContainer()
ok = c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.KEY_TAB, bc)
if bc[c4d.BFM_INPUT_VALUE] == 1:
print "tab key"
bc = c4d.BaseContainer()
ok = c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.KEY_ESC, bc)
if bc[c4d.BFM_INPUT_VALUE] == 1:
self.Close()