Special Characters

Asked by weychoi

First of all, congratulations!! The project is awesome in so many ways!!

but i have one problem when i'm testing my app.

How can i send commands like "ENTER" "F1" "F2" "DELETE" and so on? I've tried a lot of things but i can't.

Can you help me please?

Thank you,

Best Regards

Ricardo W. Leon Chiang
Lima, Peru

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Tsung-Hsiang Chang
Solved:
Last query:
Last reply:
Revision history for this message
Sergey Darovskih (darovskih) said :
#1

you can emulate pressing "enter" using command type("\n")

Revision history for this message
weychoi (weychoi) said :
#2

Thank you!

Some ideas for "Delete" and "F*" ?

Revision history for this message
sikuli-saves.com (aperti) said :
#3

KEY_F1, KEY_F2, KEY_BACKSPACE, KEY_DELETE, KEY_END, etc and so forth sound like great additions.

Revision history for this message
weychoi (weychoi) said :
#4

btw: I Have one more question, when i do something like

type("/Something")

I get an error for the "/"
anyone know what's the correct sintax for that?

Thanks

Best Regards.

Revision history for this message
Tsung-Hsiang Chang (vgod) said :
#5

Tsung-Hsiang Chang suggests this article as an answer to your question:
FAQ #933: “Special Characters”.

Revision history for this message
Best Tsung-Hsiang Chang (vgod) said :
#6

Special keys are supported in 0.9.7.
For example, you can say type(Key.ESC + ":q!" + Key.ENTER) to quit vim.
See class Key in the Jython API reference for a complete list of special keys.

Revision history for this message
weychoi (weychoi) said :
#7

Thanks Tsung-Hsiang Chang, that solved my question.

Revision history for this message
maggiey (windsnowy) said :
#8

I got an error when i use the example below
NameError: Key

openApp("notepad.exe")
type("http://sikuli.org" + Key.ENTER)

Please advise, thanks.

Revision history for this message
weychoi (weychoi) said :
#9

I had the same mistake,

download the last version and try again.

best regards

Revision history for this message
maggiey (windsnowy) said :
#10

I was using Sikuli-IDE-win-20100128.exe (Self-extracting installer). I got the error.

I downloaded Sikuli-IDE-win-20100128.zip, and try again. It works!

Revision history for this message
Maikel (romerete) said :
#11

I got an error when i use the example below
NameError: Key

openApp("notepad.exe")
type("http://sikuli.org" + Key.ENTER)

I wrote "key" with the lowercase, when I write "Key.ENTER" (the "K" is uppercase), I don't have any problems.