Hi, please.
1- Which are actually the best objects to take advantage of the mouse in vanilla? I have used [MouseState], [hid], [receivecanvas] or even Pd-msg messages.
2- Are there any that allow you to move the mouse cursor?
Thanks!
mouse control objects
Hi, please.
1- Which are actually the best objects to take advantage of the mouse in vanilla? I have used [MouseState], [hid], [receivecanvas] or even Pd-msg messages.
2- Are there any that allow you to move the mouse cursor?
Thanks!
[receivecanvas] is probably the best option, as it can still operate from inside a sub-window. You can use [sendcanvas] to simulate clicks on the canvas, but I don't think there would be any way of moving the actual cursor arrow around the screen.
this is not vanilla but I have been using MouseState with TuioMouse to control the mouse pointer. you can also use it to create clicks but I am only using it to set xy position.
here is a version of the patch i use:
https://forum.pdpatchrepo.info/topic/11256/using-your-keyboard-mouse-tablet-as-a-midi-controller
the relevant subpatches in colibri.pd are:
screensize / mightymouse / hyooristics and connect
to try it:
Start the TuioMouse from the command line
java -jar path/to/TuioMouse.jar
open colibri.pd
click connect [netsend]
when you press Shift + (Z X C V B N M ; : _) keys the mouse cursor should move to a new position on screen.
it would be great to hear about other ways of doing this.
Thank you both for your suggestions. I will try them this afternoon.
I usually use [shell] with xdotool to move the pointer to the position I indicated, but I was curious if there would be something new and ready to download through deken.
TuioMouse seems to be a better solution than [shell]+xdotool.
I also tried to send mouse messages with Pd-msg, for example [mouse 100 100 0 0 0(, but they didn't worked on the GOP.
Although they did work outside the GOP area. I don't know if I'm explaining it clearly, I sure don't.
Well, thanks again!
Ah, please youaresound, testing your patch, I've solved everything but this:
you
... couldn't create
... you might be able to track this down from the Find menu.
me
... couldn't create
Any idea?
Thanks.
yeah those are just some examples i did not include in the release.
what other changes did you have to make for the patch to work?
here is a mouse click as toggle abstraction.
moose.zip
but if you want to actually "create" mouse clicks you would need to do that using Tuio. i believe you would have to add a counter to the first number [int] in the /tuio/2Dcur "set" message. but its been a while since i used that function.
one separate technique i find useful from DIY2 is having one data inlet.
[0 $1(
|
| [1 $1(
| /
|/
[inlet to-gop]
|
[route 0 1] etc.
that way you can modify gui elements from outside the gop... this might be a way of "clicking" those elements using pd-messages if you prefer that method.
sometimes i create a controls subpatch for each gop abstraction in the main patch .
| [pd controls]
| /
[gop-abs]
of course, i don't actually know what you are trying to achieve just some ideas.
Hi youaresound thanks a lot for your reply and sorry it took me so long to answer.
I'm working with Pd 0.48.1 vanilla, the other changes were simple externals through deken.
I have tried better your colibrà patch, it's very good and useful. Thank you for sharing.
I want to click on a gop slider and move it, but I don't need it either, more out of curiosity, so I'll be trying things out or looking for alternatives.
here is an example using colibri and tuiomouse to control gop sliders.guppy.pd
@macrogmittrei This will create and control a "secondary" mouse in any Pd window.......
0.all_msg.pd
It is in the pd "doc" folder.
But it only works once you have set [editmode 1( in that window.
So you can select guis, and move them around...... but not change their values directly.
So you cannot move a slider for example.
But you can change the value of a slider in a gop by sending it a message..... once you have given it a receive address.
If you want to move the cursor, click, input text to the os or another program....... (by clicking for window focus)....
You can use it to move a fader in Pd, but you need to know the screen co-ordinates, so it is useless if you move a window, or share your patch.
input_event.zip
Widows only.... sorry..... but a "C" file included that might get you started building an equivalent object for another OS.
Of course it is using the window manager, so does not know the co-ordinates inside your Pd windows.
When you click in another program (or another Pd window) you lose focus..... so.......
I use it a lot to run shows in other programs, like Premiere...... which have no direct midi or osc controls available.....
......Pd in the background taking osc messages from my phone, and choosing/ starting tracks, clicking and dragging controls, opening and selecting from menus....... etc.
More precise, and reliable, than a VNC.
David.
Well, thank you all so much for taking the time to help me.
The patches fit what I'm looking for testing, so perfect.
Regards!
Oops! Looks like something went wrong!