[request] SikuliX should be able to detect keypresses and mouse usage globally

Bug #1565417 reported by RaiMan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Medium
RaiMan

Bug Description

There's a lot of documentation on pressing keys. I'd like to know how to detect when a user _presses_ a key so the script behavior can change.

As it stands: I have to stop the script. Change some variables. Restart the script.

It would be great if I could: Start a script. Hold a key. Behavior of script changes on the fly because it detected I held down a certain key.

Is there a way to do this with Sikuli? If not; perhaps detecting user-pressed key events would be great (something akin to observe or an actionListener for when a user presses a key).

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

Since Java as the underlying system for SikuliX does not offer solutions for that, it is not supported currently (if we talk about SikuliX sitting in the background observing for keypresses that are targeted to running apps or the system).

Limited solutions are possible with SikuliX's hotkey feature.

To add a library supporting that feature is with low priority on the list for version 2
(hot candidate: https://github.com/kwhat/jnativehook)

Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 2.0.0
Revision history for this message
Sam Gleske (sam-mxracer) wrote :

To clarify, this isn't to pass in hot keys to the application. This is so Sikuli can process hot keys to change the behavior of the sikuli script. I believe this is already possible in sikuli because it intercepts CMD+SHIFT+C on Mac and ALT+SHIFT+C on Windows.

The point is to change the behavior of the sikuli script itself. i.e. when a key press is detected perhaps toggle a boolean in the sikuli script.

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

ok, thanks for clarification:

--- process hot keys to change the behavior of the sikuli script
... this is possible:
http://sikulix-2014.readthedocs.org/en/latest/interaction.html#listening-to-global-hotkeys

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

Other bug subscribers

Related questions

Remote bug watches

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