turning on high contrast mode using sikuli

Asked by caroline

i'm pretty new to Sikuli but im a bit stumped as to why i cant get sikuli script to switch on high contrast mode on a windows (2012 server) hy using the following
type(Key.PRINTSCREEN, KeyModifier.ALT|KeyModifier.SHIFT)
the script runs and seems to complete with no errors
I also should point out I'm using this script on a VM

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
RaiMan (raimund-hocke) said :
#1

There are some reasons, why this does not work:
- VM: script running on host or guest
- focus problem (shortcut goes to wrong app)
- Java Robot keystrokes are blocked

So you should first check, wether a simple type("x") into an editor window works in your environment.

Revision history for this message
caroline (cah99) said :
#2

the script is running on my the vm directly - so is this guest?
I also checked I could type("x") into notepad and that works fine too
what are Java Robot keystrokes?

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

Sikuli deep inside works with Java and the Java feature behind the keyboard and mouse actions is done with the Java Robot class (an accessor module for the screen, mouse and keyboard devices).

Since type("x") works, the reason that the shortcut does not work, might have the following reasons:
- blocked by system if not from keyboard (try to run script as admin)
- wrong simulated key combination (try without shift)
- not accepted through VM (try manually)
- the typed key combination is not recognised by the system at all (no solution)

Can you help with this problem?

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

To post a message you must log in.