How to type numerical characters in french local system --- use paste()

Asked by lauvray

hello,

Currently on windows 7 localized in French local system, when typing numerical characters, then character sent are not the right one.

I am want to write string123 in a web field on a web navigator or on notepad
For example : script sikuli
Num = 123
chaine = str(Num).zfill(3)
wait("img.png")
wait(1)
type("string" + chaine)

Then following string is send to the field:
string&é"

but in the sikuli console right characters are displayed:
[log] TYPE "string123"

The issue is due to the difference localization between French and US computer keyboard
& is the lower case of 1
é is the lower case of 2
" is the lower case of 3

string123
[log] TYPE "string123"

for reference see following french key board map :
http://www.google.fr/imgres?imgurl=http://www.lehman.edu/faculty/hoffmann/itc/techteach/keyboard/keybfr.gif&imgrefurl=http://www.lehman.edu/faculty/hoffmann/itc/techteach/keyboard/keyboard.htm&h=241&w=500&sz=7&tbnid=GeV6p31hzB7TPM:&tbnh=61&tbnw=126&prev=/search%3Fq%3Dimage%2Bfrench%2Bkeyboard%26tbm%3Disch%26tbo%3Du&zoom=1&q=image+french+keyboard&usg=__bPEUFGsTobftP3pmvzsKB6KBNbQ=&docid=UuetOojxLj1YEM&hl=fr&sa=X&ei=7rRRUZq8FdOy7Aak2ICYCw&ved=0CFoQ9QEwBg&dur=10089

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
lauvray (lucesc-auvray) said :
#1

So my question : what is the solution to type with sikuli my text like string123 ?
Thanks and best regards
Luc

Revision history for this message
RaiMan (raimund-hocke) said :
#2

as mentioned in the docs: type() only works with the standard US qwerty keyboard layout.

With other layouts you have to use paste() instead.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

in the case of numbers only this might work:

type("123", KeyModifier.SHIFT)

if it works, you have to split one type() into multiple type()'s for non-number groups and number groups.

Can you help with this problem?

Provide an answer of your own, or ask lauvray for more information if necessary.

To post a message you must log in.