From 430c2443455673d87af07af024caf872ff4f2b68 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 4 Jun 2005 15:51:39 +0000 Subject: updated joystick support on Mac OS X so that joystick twist is set to abs_rz and throttle is set to abs_throttle even when devices use different code pages (USB HID spec sucks!); minor code cleanups svn path=/trunk/externals/hcs/hid/; revision=3111 --- joystick.pd | 123 +++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 76 insertions(+), 47 deletions(-) (limited to 'joystick.pd') diff --git a/joystick.pd b/joystick.pd index 23126d9..5ea64cc 100644 --- a/joystick.pd +++ b/joystick.pd @@ -1,53 +1,82 @@ -#N canvas 246 181 839 627 10; -#X msg 96 64 start; -#X msg 105 83 stop; -#X obj 77 30 inlet; -#X obj 207 160 print UNKNOWN_JOYSTICK_EVENT_TYPE; -#X obj 430 289 print UNKNOWN_JOYSTICK_EVENT_CODE; -#X obj 38 508 outlet; -#X obj 300 342 outlet; -#X obj 366 317 outlet; -#X text 52 244 codes (0=X 1=Y 6=throttle 7=rudder \, 16=hat0X \, 17=hat0Y) +#N canvas 181 117 827 593 10; +#X msg 176 64 start; +#X msg 185 83 stop; +#X obj 157 30 inlet; +#X obj 287 160 print UNKNOWN_JOYSTICK_EVENT_TYPE; +#X obj 118 508 outlet; +#X obj 380 342 outlet; +#X obj 446 317 outlet; +#X text 132 244 codes (0=X 1=Y 6=throttle 7=rudder \, 16=hat0X \, 17=hat0Y) ; -#X obj 411 417 outlet; -#X obj 77 107 hid \$1; -#X obj 103 468 outlet; -#X obj 169 428 outlet; -#X obj 235 387 outlet; -#X obj 221 91 print RAW; -#X text 401 433 button code/value list; -#X text 91 509 X-axis; -#X text 152 468 Y-axis; -#X text 222 430 twist; +#X obj 625 262 outlet; +#X obj 157 107 hid \$1; +#X obj 183 468 outlet; +#X obj 249 428 outlet; +#X obj 315 387 outlet; +#X obj 301 91 print RAW; +#X text 574 280 button code/value list; +#X text 171 509 X-axis; +#X text 232 468 Y-axis; +#X text 302 430 twist; #X text 11 552 (C) Copyright 2004 Hans-Christoph Steiner ; #X text 228 566 released under the GNU GPL; #X text 424 566 $Author: eighthave $; -#X text 424 553 $Revision: 1.5 $$Date: 2005-03-03 20:03:34 $; -#X obj 38 264 route abs_x abs_y abs_rz abs_throttle abs_hat0x abs_hat0y -; -#X text 287 388 throttle/slider; -#X text 346 343 hat0x; -#X text 416 319 hat0y; -#X obj 235 368 autoscale 0 1; -#X obj 169 409 autoscale 0 1; -#X obj 103 449 autoscale 0 1; -#X obj 38 489 autoscale 0 1; +#X text 424 553 $Revision: 1.6 $$Date: 2005-06-04 15:51:39 $; +#X text 367 388 throttle/slider; +#X text 426 343 hat0x; +#X text 496 319 hat0y; +#X obj 315 368 autoscale 0 1; +#X obj 249 409 autoscale 0 1; +#X obj 183 449 autoscale 0 1; +#X obj 118 489 autoscale 0 1; #X text 8 6 [joystick]; -#X obj 79 139 route abs key ff; -#X connect 0 0 10 0; -#X connect 1 0 10 0; -#X connect 2 0 10 0; -#X connect 10 0 32 0; -#X connect 23 0 30 0; -#X connect 23 1 29 0; -#X connect 23 2 28 0; -#X connect 23 3 27 0; -#X connect 23 4 6 0; -#X connect 23 5 7 0; -#X connect 27 0 13 0; -#X connect 28 0 12 0; -#X connect 29 0 11 0; -#X connect 30 0 5 0; -#X connect 32 0 23 0; -#X connect 32 1 9 0; +#X obj 159 139 route abs key ff; +#X msg 23 300 reset; +#N canvas 657 99 454 304 reset_on_open 0; +#X obj 37 19 inlet; +#X obj 37 226 outlet; +#X obj 37 116 select open; +#X obj 37 196 spigot 0; +#X obj 37 64 unpack symbol float; +#X obj 165 85 t f b; +#X obj 165 148 !=; +#X obj 181 126 f -1; +#X text 9 256 This object sends a bang to the outlet when getting an +[open( message that opens a new device but not when opening the existing +device.; +#X connect 0 0 4 0; +#X connect 2 0 3 0; +#X connect 3 0 1 0; +#X connect 4 0 2 0; +#X connect 4 1 5 0; +#X connect 5 0 6 0; +#X connect 5 0 7 1; +#X connect 5 1 7 0; +#X connect 6 0 3 1; +#X connect 7 0 6 1; +#X restore 23 110 pd reset_on_open; +#X obj 118 264 route abs_x abs_y abs_rz abs_throttle abs_hat0x abs_hat0y +; +#X connect 0 0 9 0; +#X connect 1 0 9 0; +#X connect 2 0 9 0; +#X connect 2 0 32 0; +#X connect 9 0 30 0; +#X connect 25 0 12 0; +#X connect 26 0 11 0; +#X connect 27 0 10 0; +#X connect 28 0 4 0; +#X connect 30 0 33 0; +#X connect 30 1 8 0; +#X connect 31 0 28 0; +#X connect 31 0 27 0; +#X connect 31 0 26 0; +#X connect 31 0 25 0; +#X connect 32 0 31 0; +#X connect 33 0 28 0; +#X connect 33 1 27 0; +#X connect 33 2 26 0; +#X connect 33 3 25 0; +#X connect 33 4 5 0; +#X connect 33 5 6 0; -- cgit v1.2.1