Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32306
Modified Files: Tag: desiredata desire.tk Log Message: more on keyboard macro
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.317 retrieving revision 1.1.2.600.2.318 diff -C2 -d -r1.1.2.600.2.317 -r1.1.2.600.2.318 *** desire.tk 8 Aug 2007 06:49:52 -0000 1.1.2.600.2.317 --- desire.tk 8 Aug 2007 16:32:00 -0000 1.1.2.600.2.318 *************** *** 379,384 **** set r {} foreach event $@list { ! mset {type W X Y x y mod K k} $event ! lappend r [format "%-13s %9s %4d %4d %4d %4d %4d %4d %s" $type $K $k $X $Y $x $y $mod $W] } return $r --- 379,384 ---- set r {} foreach event $@list { ! mset {type W x y mod K k} $event ! lappend r [format "%-13s %9s %4d %4d %4d %4d %s" $type $K $k $x $y $mod $W] } return $r *************** *** 570,579 **** foreach type {KeyPress KeyRelease} { foreach {subtype mod} $mods { ! bind all <$subtype$type> "$::event_history add [list $type %W %X %Y %x %y $mod %K %k]" } } foreach type {ButtonPress ButtonRelease} { foreach {subtype mod} $mods { ! bind all <$subtype$type> "$::event_history add [list $type %W %X %Y %x %y $mod %b %b]" } } --- 570,579 ---- foreach type {KeyPress KeyRelease} { foreach {subtype mod} $mods { ! bind all <$subtype$type> "$::event_history add [list $type %W %x %y $mod %K %k]" } } foreach type {ButtonPress ButtonRelease} { foreach {subtype mod} $mods { ! bind all <$subtype$type> "$::event_history add [list $type %W %x %y $mod %b %b]" } } *************** *** 2321,2325 ****
def Macro add {mess} { ! mset {event widget X Y x y mode k kval} $mess if {[regexp {^Control_} $k]} {return} if {[regexp {^Alt_} $k]} {return} --- 2321,2325 ----
def Macro add {mess} { ! mset {event widget x y mode k kval} $mess if {[regexp {^Control_} $k]} {return} if {[regexp {^Alt_} $k]} {return} *************** *** 2348,2352 ****
def Macro offset {new_x new_y} { ! mset {event widget X Y x y mode k kval} [lindex $@list 0] set @offset_x [expr $new_x-$x] set @offset_y [expr $new_y-$y] --- 2348,2352 ----
def Macro offset {new_x new_y} { ! mset {event widget x y mode k kval} [lindex $@list 0] set @offset_x [expr $new_x-$x] set @offset_y [expr $new_y-$y] *************** *** 2355,2363 **** def Macro play {delay} { if {$@idx == [llength $@list]} {return} ! $self test_canvas_size set i 0 set focus [string range [focus] 1 [string first . [focus] 2]-1] set step [lindex $@list $@idx] ! mset {event widget X Y x y mode k kval} $step switch $event { #KeyRelease {set name [modekey $k $mode]} --- 2355,2363 ---- def Macro play {delay} { if {$@idx == [llength $@list]} {return} ! #$self test_canvas_size set i 0 set focus [string range [focus] 1 [string first . [focus] 2]-1] set step [lindex $@list $@idx] ! mset {event widget x y mode k kval} $step switch $event { #KeyRelease {set name [modekey $k $mode]} *************** *** 2369,2374 **** } if {$@idx < [llength $@list]} { ! after $delay [list $self run $event $name $k [expr $X+$@offset_x] [expr $Y+$@offset_y] \ ! [expr $x+$@offset_x] [expr $y+$@offset_y]] } } --- 2369,2375 ---- } if {$@idx < [llength $@list]} { ! #after $delay [list $self run $event $name $k [expr $X+$@offset_x] [expr $Y+$@offset_y] \ ! # [expr $x+$@offset_x] [expr $y+$@offset_y]] ! after $delay [list $self run $event $name $k $x $y] } } *************** *** 2379,2383 **** set y1 66666; set y2 0 foreach step $@list { ! mset {event widget X Y x y mode k kval} $step set x1 [min $X $x1]; set x2 [max $x2 $X] set y1 [min $Y $y1]; set y2 [max $y2 $Y] --- 2380,2384 ---- set y1 66666; set y2 0 foreach step $@list { ! mset {event widget x y mode k kval} $step set x1 [min $X $x1]; set x2 [max $x2 $X] set y1 [min $Y $y1]; set y2 [max $y2 $Y] *************** *** 2395,2399 **** }
! def Macro run {event name k X Y x y} { set w [focus] incr @idx --- 2396,2400 ---- }
! def Macro run {event name k x y} { set w [focus] incr @idx *************** *** 2406,2420 **** def Macro copy {} { clipboard clear set i 0 foreach step $@list { if {$i == [expr [llength $@list]-1]} {set comma ""} else {set comma ","} ! mset {event widget X Y x y mode k kval} $step switch $event { ! KeyPress {clipboard append ${step}$comma} ! ButtonPress {clipboard append ${step}$comma} ! ButtonRelease {clipboard append ${step}$comma} } incr i } }
--- 2407,2431 ---- def Macro copy {} { clipboard clear + selection clear set i 0 foreach step $@list { if {$i == [expr [llength $@list]-1]} {set comma ""} else {set comma ","} ! mset {event widget x y mode k kval} $step ! set mess [list $event $x $y $mode $k] ! set t ${mess}$comma switch $event { ! KeyPress {clipboard append $t} ! ButtonPress {clipboard append $t} ! ButtonRelease {clipboard append $t} } incr i } + selection handle -selection PRIMARY [focus] "$self getdata" + selection own -command lost -selection PRIMARY + } + + def Macro getdata {offset maxchar} { + puts "clipboard ::: [clipboard get]" + return [string range [format %s [clipboard get]] $offset [expr {$offset+$maxChars}]] }
*************** *** 2425,2429 **** def Canvas macro_toggle {} {if {![$::macro state]} {set ::macro_state 1} {$::macro state= 0; $::macro dump}} #def Canvas macro_play {} {puts ">> $@click_at <<"; $::macro idx= 0; $::macro play [$::macro delay]} ! def Canvas macro_play {} {mset {x y} $@click_at; $::macro test_playable $x $y} def Canvas keyevent {} { focus [$self widget] --- 2436,2444 ---- def Canvas macro_toggle {} {if {![$::macro state]} {set ::macro_state 1} {$::macro state= 0; $::macro dump}} #def Canvas macro_play {} {puts ">> $@click_at <<"; $::macro idx= 0; $::macro play [$::macro delay]} ! def Canvas macro_play {} { ! mset {x y} $@click_at ! $::macro play [$::macro delay] ! #$::macro test_playable $x $y ! } def Canvas keyevent {} { focus [$self widget] *************** *** 8340,8344 ****
def KeyboardDialog notice {origin add event} { ! mset {type W X Y x y mod K k} $event if {![info exists ::keyboard_row_of($k)]} {puts "unknown key $k"; return} set i $::keyboard_row_of($k) --- 8355,8359 ----
def KeyboardDialog notice {origin add event} { ! mset {type W x y mod K k} $event if {![info exists ::keyboard_row_of($k)]} {puts "unknown key $k"; return} set i $::keyboard_row_of($k)