From 13a1eadd9c94e9446dcbc31e02324c7f048f718d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 17 Aug 2007 16:22:51 +0000 Subject: reordered the numbering using the script svn path=/trunk/; revision=8628 --- doc/tutorials/intro/48.grabbing_keystrokes.pd | 61 +++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 doc/tutorials/intro/48.grabbing_keystrokes.pd (limited to 'doc/tutorials/intro/48.grabbing_keystrokes.pd') diff --git a/doc/tutorials/intro/48.grabbing_keystrokes.pd b/doc/tutorials/intro/48.grabbing_keystrokes.pd new file mode 100644 index 00000000..8bf37e15 --- /dev/null +++ b/doc/tutorials/intro/48.grabbing_keystrokes.pd @@ -0,0 +1,61 @@ +#N canvas 10 40 620 460 12; +#X obj 10 10 cnv 15 400 40 empty empty grabbing_keystrokes 20 12 0 +24 -228992 -66577 0; +#X obj 115 152 key; +#X floatatom 115 176 5 0 0 0 - - -; +#X text 284 216 This times how long between each; +#X text 284 232 press of the 'a' key.; +#X floatatom 215 176 5 0 0 0 - - -; +#X obj 215 152 keyup; +#X floatatom 315 176 5 0 0 0 - - -; +#X obj 315 152 keyname; +#X symbolatom 379 176 10 0 0 0 - - -; +#X text 20 231 't' key as toggle:; +#X obj 68 303 select 116; +#X obj 68 272 keyup; +#N canvas 10 40 620 460 /SUBPATCH/ 0; +#X obj 101 10 inlet; +#X obj 100 100 tgl 32 0 empty \$0-tgl empty 0 -6 0 8 -166441 -166441 +-262144 0 1; +#X obj 156 68 select 1; +#X msg 172 186 color \$1 \$2 \$3; +#X msg 268 146 1 1 0; +#X msg 133 144 -65281 0 -1; +#X obj 268 85 bang; +#X obj 176 241 send \$0-tgl; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 6 0; +#X connect 3 0 7 0; +#X connect 4 0 3 0; +#X connect 5 0 3 0; +#X connect 6 0 4 0; +#X coords 0 -1 1 1 32 32 1 100 100; +#X restore 68 327 pd; +#X text 13 63 Pd provides a set of objects for getting events from +the keyboard. [key] outputs on key down \, [keyup] outputs on key up +\, and [keyname] outputs both key up and key down \, and gives a symbolic +name for the current key.; +#X text 21 391 These objects will only grab keys when this window has +focus. If you click on the Pd window \, this window won't get key events +anymore.; +#X obj 376 259 key; +#X floatatom 376 283 5 0 0 0 - - -; +#X obj 475 261 keyup; +#X obj 376 312 select 97; +#X obj 475 312 select 97; +#X obj 411 341 timer; +#X floatatom 411 367 5 0 0 0 - - -; +#X connect 1 0 2 0; +#X connect 6 0 5 0; +#X connect 8 0 7 0; +#X connect 8 1 9 0; +#X connect 11 0 13 0; +#X connect 12 0 11 0; +#X connect 16 0 17 0; +#X connect 17 0 19 0; +#X connect 18 0 20 0; +#X connect 19 0 21 0; +#X connect 20 0 21 1; +#X connect 21 0 22 0; -- cgit v1.2.1