Screenshot hotkey uses first char of key description instead of key

Bug #594529 reported by Lars Kobbe
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
High
Unassigned

Bug Description

I'm using a German version of Sikuli 0.10.1 on Win XP 32. Whatever hotkey I assign to the screen shots, Sikuli always uses the first character of the hotkey description instead of the actual key. Example: "Alt + S" would make "a" the hotkey, "Space" results in "s" as a hotkey, and "Enter" would make Sikuli intercept the "e" key and start a screen shot.

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

Same here, this is really annoying.

My solution is to have Sikuli IDE only active while i have to take patterns, else i close it and write the code in an external editor.

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

A little BUMP though this is annoying.

Revision history for this message
Dr-Z (jmkuhnigk) wrote :

Same problem here, using Vista-64 and Sikuli 0.10.1. REALLY confusing.

Changed in sikuli:
importance: Undecided → High
Revision history for this message
niknah (hankin0) wrote :

Apparently jintellitype didn't support anything other than a-z 0-9 (and F1-10) until recently...

http://melloware.com/products/jintellitype/changes-report.html

But I just tried this new version and it still doesn't work right, they're using the VK_.... key information from java instead of windows which is different. Have sent the author an email about it.

The new version also supports 64bit jre, may fix some other people's problems with link errors in windows 64bit.

Revision history for this message
Rolf Wilms (rolf-wilms) wrote :

There is also a localization problem which causes some modifier keys (all except ALT) to be ignored with my german locale (de_DE).

It seems that
  java.awt.event.KeyEvent.getKeyModifiersText(int modifiers)
returns localized modifier names such as STRG+UMSHALT, whereas
  JIntellitype.registerHotKey(int identifier, String modifierAndKeyCode)
always requires english modifier names, such as CTRL+SHIFT.

As a workaround I can either switch my Windows system locale to English, or add
  -Duser.language=en -Duser.region=US
to Sikuli-IDE.bat, which is more convenient because it just switches Sikuli to English

As a solution (didn't try it out, just a guess) I'd propose to do the actual registration of the hotkey using
  JIntellitype.registerSwingHotKey(int identifier,
                                int modifier,
                                int keycode)
and thus being independent of key and modifier names.

I also tried JIntellitype 1.3.4 and, together with the english locale, keys other than a-z 0-9 (and F1-10) work fine, for example CTRL+ALT+SHIFT+HOME.

Revision history for this message
Rolf Wilms (rolf-wilms) wrote :

Meanwhile I can build and test. The proposed solution from comment #5 works quite well.
It turns out that this way special keys (like End) can even be registered with JIntellitype 1.3.2.

Patch is attached.

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

Thanks for the patch. :)

Changed in sikuli:
milestone: none → x1.0-rc1
Changed in sikuli:
status: New → Fix Committed
Revision history for this message
David Linke (dr-david-linke) wrote :

In Sikuli X 1.0 RC1 released on 2010-12-23 this Bug is still present (German Windows XP System).

As before, Sikuli always uses the character of the hotkey description instead of the actual key, e.g. "2" (on the main keybord) instead of Ctrl+Shift+2 for making a screenshot for the default konfiguration. Interestingly the "2" from the numeric keyboard is ignored with or without Ctrl+Shift modifier.

Revision history for this message
David Linke (dr-david-linke) wrote :

Tested a bit more: ALT+2 works (acceptable workaround), but the default "CTRL+SHIFT+2" (in German "Strg+Umschalt 2") does not.

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

@ David:
in Win7 it works perfectly and no other people did mention this until now.

Are you sure, that you have removed everything, that points to 10.2 stuff (e.g. system path)?

Before using the Sikuli X installer you have to uninstall Sikuli 10.2 using the windows standard software uninstall.

Revision history for this message
David Linke (dr-david-linke) wrote :

It works fine now! - The problem was probably due to some old files. I completely removed Sikuli 10.2 and the last beta. This time I made sure that nothing was left in the install folders. Then I reinstalled Sikuli X.

RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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