Special Characters

Asked by weychoi on 2010-01-27

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:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Tsung-Hsiang Chang
Solved:
2010-01-28
Last query:
2010-01-28
Last reply:
2010-01-28
Sergey Darovskih (darovskih) said : #1

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

weychoi (weychoi) said : #2

Thank you!

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

sikuli-saves.com (aperti) said : #3

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

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.

Tsung-Hsiang Chang (vgod) said : #5

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

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.

weychoi (weychoi) said : #7

Thanks Tsung-Hsiang Chang, that solved my question.

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.

weychoi (weychoi) said : #9

I had the same mistake,

download the last version and try again.

best regards

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!

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.