[request] type() should work with different keymap (e.g. dvorak)

Bug #511740 reported by Tsung-Hsiang Chang
86
This bug affects 18 people
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Wishlist
RaiMan

Bug Description

reported by gugod, Matthew Schinckel.

Tags: fkt-type
Revision history for this message
Ozan Onay (ozan-onay) wrote :

I am seeing this behaviour on Sikuli-IDE-osx-10.5-20091028.

When the run-time keyboard is set to a non-query layout, `type`d letters are incorrectly mapped. For instance, Hello World is typed as "D.nnr <rpne" when the run-time keyboard layout is Dvorak.

Revision history for this message
duryodhan (duryodhan) wrote :

also affects Sikuli-IDE-osx-10.6-20091221

Revision history for this message
Tsung-Hsiang Chang (vgod) wrote :

in rev 8, we added a new API paste() to send text to applications via clipboard. (which is independent to keymaps)

Changed in sikuli:
status: New → In Progress
Revision history for this message
Carlos Diener / emonkey (emonkey) wrote :

Workaround with paste() works fine.

Revision history for this message
Lars Kobbe (lars-kobbe) wrote :

I have a similar problem with German keyboard layout. Using Type with "<email address hidden>" gives a wrong result. Instead of the @ sign, it types a double quote - which is Shift+2 on the German keyboard.

Revision history for this message
RaiMan (raimund-hocke) wrote :

This is due to the fact, that internally things are still mapped to the standard US keyboard - no internationalization in this area yet.

This works for me on Mac and Win7 (don't ask me why ;-)
type("something")
keyDown(Key.ALT) # press and hold
type("q") # this is the place of the @ on german keyboard (type("l") # on Mac (lowercase L))
keyUp() # release all pressed keys
type("mailaddress.com")

Revision history for this message
RaiMan (raimund-hocke) wrote :

Of course the paste() works too, but clutters clipboard and makes getClipboard() impossible.

Revision history for this message
Gregor Kopka (mailfrom-launchpad-net) wrote :

Also a problem when trying to control applications which sample the keyboard lower-level, or don't support the clipboard (eg. certain applications with hardware accelerated graphics)

RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → Wishlist
summary: - type() doesn't send the right keys if using different keymap (e.g.
- dvorak)
+ [request] type() should work with different keymap (e.g. dvorak)
Revision history for this message
Olof Bjarnason (objarni) wrote :

Has there been any progress on this wishlist item?

Revision history for this message
RaiMan (raimund-hocke) wrote :

@Olof
No movement yet.

Revision history for this message
Lexen (lexen1) wrote :

This bug is not present on the 64bit Linux version of rc1, rc2 or rc3.

Revision history for this message
Jan (oa-aegiqter-ot) wrote :

Mac OS X v10.7.4
Sikuli X-1.0rc3 (r905)

Still problems with my keyboard mappings:

German keyboard: "-" becomes "ß"

Chinese keyboard: "你好“ throws even an exception:
[log] TYPE "你好"
[error] Abgebrochen
[error] Ein Fehler in Zeile 25
[error] Fehlermeldung:
Traceback (most recent call last):
 File "/var/folders/zw/y3s7246958s6_vvpdp50shsc0000gn/T/sikuli-tmp7966794094571103423.py", line 25, in
 type("你好")
 at org.sikuli.script.Key.toJavaKeyCode(Key.java:284)
 at org.sikuli.script.DesktopRobot.typeChar(DesktopRobot.java:118)
 at org.sikuli.script.Region.type(Region.java:809)
 at org.sikuli.script.Region.type(Region.java:789)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)

java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Cannot convert character �

Revision history for this message
RaiMan (raimund-hocke) wrote :

@ Jan
The situation is the same from beginning and has not yet changed:
type() only works with the standard qwerty US-keyboard.

faq 933

RaiMan (raimund-hocke)
Changed in sikuli:
assignee: nobody → RaiMan (raimund-hocke)
tags: added: fkt-type
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.