Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20944
Modified Files: Tag: desiredata desire.tk Log Message: event recording catches Shift-... Control-... Alt-... properly, with modifier numbers.
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.218 retrieving revision 1.1.2.600.2.219 diff -C2 -d -r1.1.2.600.2.218 -r1.1.2.600.2.219 *** desire.tk 11 Jul 2007 18:59:33 -0000 1.1.2.600.2.218 --- desire.tk 11 Jul 2007 20:58:58 -0000 1.1.2.600.2.219 *************** *** 28,32 **** # #-----------------------------------------------------------------------------------# ! # this command rebuilds the package index: echo pkg_mkIndex . | tclsh
--- 28,32 ---- # #-----------------------------------------------------------------------------------# ! # this command rebuilds the package index: echo pkg_mkIndex . | tclsh
*************** *** 334,338 **** def EventHistory init {} {super; set @list {}} def EventHistory add {e} {lappend @list $e; $self changed add $e} ! def EventHistory list {} {lreverse $@list} set ::event_history [EventHistory new]
--- 334,338 ---- def EventHistory init {} {super; set @list {}} def EventHistory add {e} {lappend @list $e; $self changed add $e} ! def EventHistory list {} {return $@list} set ::event_history [EventHistory new]
*************** *** 490,501 **** bind Text <Control-t> {} bind Text <Control-s> {} ! bind all <KeyPress> {event_record KeyPress %W %X %Y %K} ! bind all <KeyRelease> {event_record KeyRelease %W %X %Y %K} ! bind all <ButtonPress> {event_record ButtonPress %W %X %Y %b} ! bind all <ButtonRelease> {event_record ButtonRelease %W %X %Y %b} }
! proc event_record {type W X Y K} { ! $::event_history add [format "%13s %9s %4d %4d %s" $type $K $X $Y $W] }
--- 490,508 ---- bind Text <Control-t> {} bind Text <Control-s> {} ! set mods {{} 0 Shift- 1 Control- 4 Alt- 8} ! foreach type {KeyPress KeyRelease} { ! foreach {subtype mod} $mods { ! bind all <$subtype$type> "event_record $type %W %X %Y $mod %K" ! } ! } ! foreach type {ButtonPress ButtonRelease} { ! foreach {subtype mod} $mods { ! bind all <$type> "event_record $type %W %X %Y $mod %b" ! } ! } }
! proc event_record {type W X Y mod K} { ! $::event_history add [format "%-13s %9s %4d %4d %4d %s" $type $K $X $Y $mod $W] }
*************** *** 1072,1077 **** quit} $self populate_menu help { ! about documentation class_browser client_class_tree clipboard_view command_history_view event_history_view do_what_i_mean {} ! test_audio_and_midi load_meter latency_meter} }
--- 1079,1085 ---- quit} $self populate_menu help { ! about documentation class_browser do_what_i_mean {} ! test_audio_and_midi load_meter latency_meter {} ! clipboard_view command_history_view event_history_view keyboard_view client_class_tree} }
*************** *** 1088,1091 **** --- 1096,1101 ---- Listener new .pd " Pd Server" pd_eval } + wm geometry .[$self keyboard_view] -0+0 + wm geometry .[$self event_history_view] -0-0 }
*************** *** 1455,1461 **** def Client audio_on {} {netsend [list pd dsp 1]} def Client audio_off {} {netsend [list pd dsp 0]} def Client clipboard_view {} {ClipboardDialog new $::clipboard} def Client command_history_view {} { ListDialog new $::command_history [say command_history_view]} ! def Client event_history_view {} { [[ListDialog new $::event_history [say event_history_view]] listbox] configure -font {Mono -10}} def Client do_what_i_mean {} {wonder}
--- 1465,1475 ---- def Client audio_on {} {netsend [list pd dsp 1]} def Client audio_off {} {netsend [list pd dsp 0]} + def Client keyboard_view {} { KeyboardDialog new $::event_history} def Client clipboard_view {} {ClipboardDialog new $::clipboard} def Client command_history_view {} { ListDialog new $::command_history [say command_history_view]} ! def Client event_history_view {} { ! set dialog [ListDialog new $::event_history [say event_history_view]] ! [$dialog listbox] configure -font {Mono -10} ! return $dialog} def Client do_what_i_mean {} {wonder}
*************** *** 7870,7874 **** set @history $history wm title .$self $title ! pack [listbox .$self.list -yscrollcommand ".$self.scroll set" -width 72] -side left -fill both -expand yes pack [scrollbar .$self.scroll -command ".$self.list yview"] -side right -fill y $@history subscribe $self --- 7884,7888 ---- set @history $history wm title .$self $title ! pack [listbox .$self.list -yscrollcommand ".$self.scroll set" -width 72 -height 20] -side left -fill both -expand yes pack [scrollbar .$self.scroll -command ".$self.list yview"] -side right -fill y $@history subscribe $self *************** *** 7881,7884 **** --- 7895,7899 ---- .$self.list delete 0 end foreach e [$@history list] {.$self.list insert end $e} + .$self.list see end }
*************** *** 7915,7921 **** } {set keyboard_text_of($k) $v}
! def KeyboardDialog init {} { super close ! set @history $::event_history wm title .$self "Keyboard View" ;# say set i 0; set j 0 --- 7930,7936 ---- } {set keyboard_text_of($k) $v}
! def KeyboardDialog init {history} { super close ! set @history $history wm title .$self "Keyboard View" ;# say set i 0; set j 0 *************** *** 7942,7947 **** set row $::keyboard_row_of($k) switch -- $type { ! KeyPress {puts "$k on"; .$self.$row.key$k configure -bg "#ff0000"} ! KeyRelease {puts "$k off"; .$self.$row.key$k configure -bg "#dddddd"} } } --- 7957,7962 ---- set row $::keyboard_row_of($k) switch -- $type { ! KeyPress {.$self.$row.key$k configure -bg "#ff0000"} ! KeyRelease {.$self.$row.key$k configure -bg "#dddddd"} } } *************** *** 8108,8112 **** } puts "$nodes" - foreach wire $@wires { mset {obj1 port1 obj2 port2} [$wire report] --- 8123,8126 ---- *************** *** 8116,8128 **** } #$g layout ! #if {[info exists debug]} { ! # puts [$g render] ;# see what render produces ! #} #eval [$g render] set f {} set fd [open graph.txt w] $g write $fd plain - close $fd set fd [open graph.txt r] set contents [read $fd] --- 8130,8141 ---- } #$g layout ! ;# see what render produces ! #if {$debug} {puts [$g render]} #eval [$g render] set f {} set fd [open graph.txt w] $g write $fd plain close $fd + set fd [open graph.txt r] set contents [read $fd] *************** *** 8146,8150 **** } } - - after 100 {KeyboardDialog new} - --- 8159,8160 ----