I am trying to use keyboarddialog to create a simple keyboard to have user enter an email address. Nothing special.
function setemail()
?"IN SETEMAIL"
keyboarddialog = createObject("roSGNode", "KeyboardDialog")
keyboarddialog.title= "Enter Email Address"
keyboarddialog.visible = true
keyboarddialog.buttons=["Continue","Cancel"]
m.key=keyboarddialog.keyboard
m.key.showTextEditBox= true
m.top.setFocus(true)
m.top.dialog = keyboarddialog
return m.key.text
end function
Function onKeyEvent(key as String, press as Boolean) as Boolean
button_val = m.top.dialog.buttonSelected
if not press then
if key = "OK"
if(button_val = 0)
?"EMAIL "m.key.text
m.top.dialog.close = true
return true
else if (button_val = 1)
Print "CANCEL"
m.top.dialog.close = true
return true
end if
end if
end if
return FALSE
end function
My problem lies in the onKey function. Each time I press OK to accept the character for the email, the onKey fires of course executing the button_val=0 so I never get the complete email put in because of this. Can somebody guide me as to fixing this?
Thanks