WINDOWS KEY how???

Asked by Ezequiel

Hi all....
I need open the RUN window, in windows7

I tried :
keyDown(Key.WIN)
keyUp()
but I get the following error:

[error] Ocurrió un error en la línea 1
[error] Mensaje de error: Traceback (most recent call last):
 File "C:\Users\edpollak\AppData\Local\Temp\sikuli-tmp7886578015894000532.py", line 1, in
 keyDown(Key.WIN)
 at sun.awt.windows.WRobotPeer.keyPress(Native Method)
at java.awt.Robot.keyPress(Unknown Source)
at org.sikuli.script.DesktopRobot.doType(DesktopRobot.java:101)
at org.sikuli.script.DesktopRobot.typeChar(DesktopRobot.java:118)
at org.sikuli.script.Region.keyDown(Region.java:881)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

Tried with this too:
type(KeyModifier.META)

but I get....:

[error] Mensaje de error: Traceback (most recent call last):
 File "C:\Users\edpollak\AppData\Local\Temp\sikuli-tmp5081655784921470837.py", line 1, in
 type(KeyModifier.META)
TypeError: type(): 1st arg can't be coerced to String

Any help please??

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Harry Readinger (temporary22) said :
#1

you can use type(KEY_WIN, "r")

that should open the "run" prompt

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

@Harry
KEY_WIN (deprecated in rc3) is a modifier key and cannot be used as the first parameter

@ Ezequiel

correct for rc2:
type("r", KEY_WIN)

beginning with rc3:
type("r", KeyModifier.WIN) # preferred

Using Key.WIN with keyDown() is still not possible with rc3 (bug 836453)

Revision history for this message
Ezequiel (pollakezequiel) said :
#3

Thanks RaiMan, that solved my question.