@Ingo this simple patch tracks the buttons for my mouse. In my case the buttons are encoded in the first byte.

see attached.



--

Mensaje telepatico asistido por maquinas.

On 26/05/2023 08:41, Ingo wrote:

Thanks, Lucas!

I just downloaded and will test now.

Ingo

*Von:*Pd-list <pd-list-boun...@lists.iem.at> *Im Auftrag von *Lucas Cordiviola
*Gesendet:* Freitag, 26. Mai 2023 04:46
*An:* pd-list@lists.iem.at
*Betreff:* Re: [PD] updated hid object?

Hi Ingo,

You can try https://deken.puredata.info/library/hidraw

You can open a device via its VID PID. From the help patch:


"open device via VID PID (shown in the console if you did "listdevices"). Note that the VID PID is hard-coded in the device and this can be used (later) without a prior "listdevices" message."


The help patch also includes links to the web on how to set HID permissions.

You can connect

[hidraw]
|
[print]

to see which bytes (in the list) change when you press the mouse buttons.

--

Mensaje telepatico asistido por maquinas.

On 25/05/2023 14:07, Ingo wrote:

    Hi there,

    I’m having trouble with using my mouse with the relatively old
    [hid] (from 2004) on my Debian with Pd 0.49.0.

    The main problem is that  “open by device type” is not working and
    I have to search the device number each time.

    I have some automated method for searching but it still takes up
    too much time when restarting frequently.

    Once I have the device number it works very well well, though!

    (I need 6-8 different mouse buttons . . . )

    I remember seeing something a while ago about either a new or
    updated alternative [hid] object.

    However, I’m not sure what it was and I don’t remember if this was
    even for Linux at all.

    Making a quick search didn’t give me any results.

    Can anyone enlighten me if there is something working more
    reliably with finding the  mouse without havin to search manually
    each time?

    Thanks

    Ingo



    _______________________________________________

    Pd-list@lists.iem.at  mailing list

    UNSUBSCRIBE and account-management 
->https://lists.puredata.info/listinfo/pd-list
#N canvas 397 131 782 540 12;
#X obj 136 126 hidraw;
#X msg 149 72 open-vidpid 7247 3 \, poll 5;
#X obj 210 27 loadbang;
#X obj 68 187 print;
#X obj 180 318 >> 1;
#X obj 233 319 >> 2;
#X obj 284 319 >> 3;
#X obj 337 320 >> 4;
#X obj 378 320 >> 5;
#X obj 431 321 >> 6;
#X obj 482 321 >> 7;
#X obj 132 371 mod 2;
#X obj 180 372 mod 2;
#X obj 231 371 mod 2;
#X obj 279 372 mod 2;
#X obj 327 372 mod 2;
#X obj 375 373 mod 2;
#X obj 426 372 mod 2;
#X obj 473 374 mod 2;
#X obj 128 420 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 184 420 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 235 422 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 281 422 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 327 423 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 373 423 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 429 422 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 475 422 tgl 19 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000 0 
1;
#X obj 141 256 t f f f f f f f f;
#X obj 143 221 change;
#X msg 144 177 \$1;
#X text 180 180 my mouse encode the buttons in the first byte;
#X text 430 268 byte to bits;
#X text 110 478 btn1;
#X text 173 475 btn2;
#X text 228 474 mouseweel-btn;
#X connect 0 0 29 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 12 0;
#X connect 5 0 13 0;
#X connect 6 0 14 0;
#X connect 7 0 15 0;
#X connect 8 0 16 0;
#X connect 9 0 17 0;
#X connect 10 0 18 0;
#X connect 11 0 19 0;
#X connect 12 0 20 0;
#X connect 13 0 21 0;
#X connect 14 0 22 0;
#X connect 15 0 23 0;
#X connect 16 0 24 0;
#X connect 17 0 25 0;
#X connect 18 0 26 0;
#X connect 27 0 11 0;
#X connect 27 1 4 0;
#X connect 27 2 5 0;
#X connect 27 3 6 0;
#X connect 27 4 7 0;
#X connect 27 5 8 0;
#X connect 27 6 9 0;
#X connect 27 7 10 0;
#X connect 28 0 27 0;
#X connect 29 0 28 0;
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to