Hello guys, i'm having an issue trying to get the position of my mouse (i'm using cyclone/mousestate) while using an other application (my purpose is to use a drawing application in the main time - like gimp, paint or ps or whatever works with pd ?)
Is there a way to get the mouse state while i'm using an other app by superposition ? Or should/could I make this link betwin pd and my drawing app in another way ?
Thanks !
-
mouse position and app superpositions
-
@pluxite I think you will have to find another way.
The operating system will only send mouse events and coordinates to the program that has its window "on top". Which makes sense as otherwise you would have no idea what you are clicking.
David. -
@pluxite In linux and probably OSX you can use ggee's shell external to run
xdotool getmouselocation
, just bang it with a metro. It's output is not fun to parse and limitations of ggee/shell mean it will be easier to just write a simple bash script likeeval $(xdotool getmouselocation --shell), echo $X $Y
, call this script (using the full path) instead of the command itself and you get a simple list of xy coordinates. xdotool can also do other fun things like send mouse or keyboard commands to other windows or screens.Edit: Not sure what I was thinking, the heat must be getting to me, much simpler. Separating two commands with a comma fails with ggee/shell since it sends them too quickly, the first command is not done when the second arrives and it also opens a new shell for the second command so even with a delay the $X and $Y variables will not be set in this new shell. Simple solution is just to replace the comma with &&, now it is a single command, the echo command is only executed if the first succeeds.