Page 1 of 1

(SOLVED) "enterinField" Not Working With Android Keyboard

Posted: Thu Jan 21, 2021 7:52 am
by Googie85
Hi Guys!!

I have the following code and I still cant get it to catch the "Enter" key press:

Code: Select all

global bobby
on keyDown theKey
   put theKey after bobby
   put "*" after field "Login"
end keyDown

on backspaceKey
   delete the last char of field "Login"
   delete the last char of bobby
end backspaceKey

on returnKey
   answer "returnKey"
end returnKey

on enterKey
   answer "enterKey"
end enterKey

on returninField
   answer "returninField"
end returninField

on enterinField
   answer "enterinField"
end enterinField
Do you think that there could be a workaround so that when the Enter key is pressed, it does nothing?

Many Thanks,

Googie.

Re: (SOLVED) "enterinField" Not Working With Android Keyboard

Posted: Fri Jan 22, 2021 6:30 am
by Googie85
I came to this solution...

Code: Select all

global bobby
on keyDown theKey
   
   if theKey = CR then
      delete line 2 of bobby
      break
   end if
   
   put theKey after bobby
   put "*" after field "Login"
end keyDown

on backspaceKey
   delete the last char of field "Login"
   delete the last char of bobby
end backspaceKey