← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #273163]: Is there an equivalent special key for RETURN button(IOS Simulator)? Key.ENTER is not working

 

Question #273163 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/273163

    Status: Open => Answered

Karl proposed the following answer:
The normal key code for the ENTER key is decimal 13. This is the
carriage return in ASCII.

I looked at the values of \n and Key.Enter on my Windows machine and the
decimal representations are both 10 -- the line feed in ASCII.  See the
code below for how.  You can figure out what code Sikuli is using in
your case, then try the other one - namely type(char(10)) or
type(char(13)). Another alternative is to add the return to the your
Hello line- i.e. type("Hello"+Key.ENTER).

App.focus("notepad")
wait(2)
type("-")
print ord("\n")
type(chr(ord("\n")))
type("-")
print ord(Key.ENTER)
type(chr(ord(Key.ENTER)))
type("-")
type(chr(10))
type("-")
type(chr(13))
type("-")

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.