#N canvas 416 23 555 619 10;
#X obj 0 635 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0
14 -228856 -66577 0;
#X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header keyname 3 12 0 18
-204280 -1 0;
#X obj 0 338 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 5 12 0 13
-228856 -1 0;
#N canvas 487 280 494 344 META 0;
#X text 12 105 LIBRARY internal;
#X text 12 145 WEBSITE http://crca.ucsd.edu/~msp/;
#X text 12 165 RELEASE_DATE 2009-06-12;
#X text 12 25 LICENSE SIBSD;
#X text 12 125 AUTHOR Miller Puckette;
#X text 12 185 HELP_PATCH_AUTHORS Dave Sabine \, July 11 \, 2003 Jonathan
Wilkes revised the patch to conform to the PDDP template for Pd version
0.42.;
#X text 12 45 DESCRIPTION get input and key name from the keyboard
;
#X text 12 65 OUTLET_0 float;
#X text 12 85 OUTLET_1 symbol;
#X text 12 5 KEYWORDS control symbol_op user_input;
#X restore 500 637 pd META;
#X obj 0 365 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 5 12 0
13 -228856 -1 0;
#X obj 0 437 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 5 12
0 13 -228856 -1 0;
#X obj 0 504 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 5 12
0 13 -228856 -1 0;
#N canvas 220 483 428 145 Related_objects 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 20 73 Externals and other object libraries;
#X obj 22 43 key;
#X text 8 2 [keyup] Related Objects;
#X obj 53 43 keyup;
#X obj 19 101 gemkeyboard;
#X obj 99 101 gemkeyname;
#X restore 102 637 pd Related_objects;
#X text 98 373 float;
#X obj 78 374 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
-162280 0;
#X text 98 342 (none);
#X obj 43 193 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#N canvas 104 188 428 356 reacting_to_user_input 0;
#X text 20 38 Most \, if not all \, programming environments provide
us with tools to capture 'user initiated' events from the operating
system. Keyboard input \, mouse clicks \, and mouse movements are the
most common events in this 'user event' category.;
#X text 20 104 Pd's [key] \, [keyup] \, and [keyname] are complimented
by the externals such as [gemmouse] and [nimouse] to provide us with
a full range of tools to gleen a user's activities at the computer.
;
#X text 34 241 onKeyUp;
#X text 34 222 onKeyDown;
#X text 34 260 onKeyPress;
#X text 21 291 hmmm...wouldn't it be great if Pd also gave us onChange
\, onBlur \, onFocus \, onClick \, onDblClick \, onDragDrop \, onLoad
\, onMouseDown \, onMouseOver \, onMouseOut \, onMouseMove \, onUnload...?
;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 21 170 It's interesting to note that with these tools \, PD
can mimic some of the functions in other languages - Javascript for
example has:;
#X text 8 2 [keyup] Reacing to User Input;
#X restore 102 563 pd reacting_to_user_input;
#X obj 493 10 keyname;
#X obj 43 139 keyname;
#X symbolatom 82 167 10 0 0 0 - - -, f 10;
#X floatatom 43 167 5 0 0 0 - - -, f 5;
#X obj 82 193 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 40 81 [keyname] reports the (system dependent) names of "printing"
keys of the keyboard. It captures both the "keydown" and "keyup" events.
;
#X text 168 373 - the left inlet produces a 1 when a key goes down
\, and a zero when the key goes up.;
#X obj 78 404 cnv 17 3 17 empty \$0-pddp.cnv.let.1 1 5 9 0 16 -228856
-162280 0;
#X text 98 403 symbol;
#X text 168 403 - the right outlet produces a symbol which represents
the name of the key.;
#X text 99 507 Caveat - this object only works if Pd actually gets
the key events which can depend on the stacking order of windows and/or
the pointer location. This is dependent on the system.;
#X obj 275 612 pddp/pddplink all_about_hid.pd -text all_about_hid;
#X text 100 613 for more on HIDs:;
#N canvas 108 160 327 410 some_keyboard_fun 0;
#X obj 52 75 loadbang;
#X msg 23 16 bang;
#X obj 33 158 qlist;
#X floatatom 33 185 5 0 0 0 - - -, f 5;
#X obj 218 30 r keyboard_fun;
#X msg 52 105 read keyboard_fun.txt;
#X msg 45 51 rewind;
#X obj 218 112 symbol add2;
#X obj 218 83 t b s;
#X obj 218 138 pack s s;
#X obj 218 164 route list;
#X msg 47 245 set;
#X msg 47 278;
#X obj 218 57 symbol;
#X text 71 17 Click here to start...;
#X msg 62 131 tempo 0.8;
#X obj 47 217 loadbang;
#X connect 0 0 5 0;
#X connect 0 0 15 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 4 0 13 0;
#X connect 5 0 2 0;
#X connect 6 0 2 0;
#X connect 7 0 9 0;
#X connect 8 0 7 0;
#X connect 8 1 9 1;
#X connect 9 0 10 0;
#X connect 10 0 12 0;
#X connect 11 0 12 0;
#X connect 13 0 8 0;
#X connect 15 0 2 0;
#X connect 16 0 11 0;
#X restore 102 589 pd some_keyboard_fun;
#X text 11 23 get input and key name from the keyboard;
#X text 168 342 - [keyname] gets input directly from the keyboard.
;
#X obj 4 637 pddp/pddplink all_about_help_patches.pd -text Usage Guide
;
#X obj 43 275 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X symbolatom 94 249 10 0 0 0 - - -, f 10;
#X floatatom 43 249 5 0 0 0 - - -, f 5;
#X obj 94 275 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 43 221 keyname 1;
#X text 98 442 1) float;
#X text 153 139 When you type on the keyboard \, [keyname] sends data
to Pd. Notice how this version reports multiple presses when holding
a key down due to autorepeat.;
#X text 164 221 By passing an optional argument 1 at creationkey object
ignores autorepeats.;
#X text 168 442 - optional argument to disable autorepeat detection.
0 or no argument will enable autorepeat reporting \, 1 will disable
it.;
#X connect 14 0 16 0;
#X connect 14 1 15 0;
#X connect 15 0 17 0;
#X connect 16 0 11 0;
#X connect 31 0 33 0;
#X connect 32 0 30 0;
#X connect 34 0 32 0;
#X connect 34 1 31 0;
