Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv857
Modified Files: Tag: devel_0_39 desire.tk Log Message: code for making the current global key table to local table
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.393 retrieving revision 1.1.2.394 diff -C2 -d -r1.1.2.393 -r1.1.2.394 *** desire.tk 22 Aug 2006 01:15:52 -0000 1.1.2.393 --- desire.tk 22 Aug 2006 13:16:30 -0000 1.1.2.394 *************** *** 509,584 ****
#-----------------------------------------------------------------------------------# ! set key(Object) "Ctrl+1" ! set key(Message) "Ctrl+2" ! set key(Number) "Ctrl+3" ! set key(Symbol) "Ctrl+4" ! set key(Comment) "Ctrl+5" ! set key(Bang) "Alt+b" ! set key(Toggle) "Alt+t" ! set key(Number2) "Alt+n" ! set key(Vslider) "Alt+v" ! set key(Hslider) "Alt+h" ! set key(Vradio) "Alt+d" ! set key(Hradio) "Alt+i" ! set key(VU) "Alt+u" ! set key(dropper) "Alt+x" ! set key(Canvas) "Alt+c" ! set key(Graph) "" ! set key(Array) "" ! set key(parentwindow) "" ! set key(Pdwindow) "" ! set key(new_file) "Ctrl+n" ! set key(open_file) "Ctrl+o" ! set key(pdrc_editor) "Ctrl+p" ! set key(ddrc_editor) "Ctrl+l" ! set key(send_message) "Ctrl+m" ! set key(paths) "" ! set key(quit) "Ctrl+q" ! set key(find) "Ctrl+f" ! set key(find_again) "Ctrl+g" ! set key(find_last_error) "" ! set key(audio_on) "Ctrl+slash" ! set key(audio_off) "Ctrl+period" ! set key(audio_settings) "" ! set key(midi_settings) "" ! set key(test_audio_and_midi) "" ! set key(load_meter) "" ! set key(latency_meter) "" ! set key(about) "" ! set key(class_browser) "" ! set key(quit) "Ctrl+q" ! set key(close) "Ctrl+w" ! set key(save) "Ctrl+s" ! set key(save_as) "Ctrl+S" ! set key(cut) "Ctrl+x" ! set key(copy) "Ctrl+c" ! set key(print) "Ctrl+p" ! set key(undo) "Ctrl+z" ! set key(redo) "Ctrl+Z" ! set key(paste) "Ctrl+v" ! set key(duplicate) "Ctrl+d" ! set key(select_all) "Ctrl+a" ! set key(text_editor) "Ctrl+t" ! set key(font_bomb) "" ! set key(tidy_up) "" ! set key(reload) "Ctrl+r" ! set key(redraw) "" ! set key(crosshair) "" ! set key(editmodeswitch) "Ctrl+e" ! set key(popup_properties) "" ! set key(popup_help) "" ! set key(popup_open) "" ! set key(client_class_tree) "Ctrl+grave" ! set key(key_nav_up) "Ctrl+up" ! set key(key_nav_down) "Ctrl+down" ! set key(key_nav_right) "Ctrl+right" ! set key(key_nav_left) "Ctrl+left" ! set key(key_nav_up_shift) "Ctrl+UP" ! set key(key_nav_down_shift) "Ctrl+DOWN" ! set key(key_nav_right_shift) "Ctrl+RIGHT" ! set key(key_nav_left_shift) "Ctrl+LEFT" ! set key(key_nav_ioselect) "Ctrl+tab" ! set key(incr_zoom) "Ctrl+equal" ! set key(decr_zoom) "Ctrl+minus" set accels {} foreach k [array names key] {dict set accels $key($k) $k} --- 509,673 ----
#-----------------------------------------------------------------------------------# ! #set key(Object) "Ctrl+1" ! #set key(Message) "Ctrl+2" ! #set key(Number) "Ctrl+3" ! #set key(Symbol) "Ctrl+4" ! #set key(Comment) "Ctrl+5" ! #set key(Bang) "Alt+b" ! #set key(Toggle) "Alt+t" ! #set key(Number2) "Alt+n" ! #set key(Vslider) "Alt+v" ! #set key(Hslider) "Alt+h" ! #set key(Vradio) "Alt+d" ! #set key(Hradio) "Alt+i" ! #set key(VU) "Alt+u" ! #set key(dropper) "Alt+x" ! #set key(Canvas) "Alt+c" ! #set key(Graph) "" ! #set key(Array) "" ! #set key(parentwindow) "" ! #set key(Pdwindow) "" ! #set key(new_file) "Ctrl+n" ! #set key(open_file) "Ctrl+o" ! #set key(pdrc_editor) "Ctrl+p" ! #set key(ddrc_editor) "Ctrl+l" ! #set key(send_message) "Ctrl+m" ! #set key(paths) "" ! #set key(quit) "Ctrl+q" ! #set key(find) "Ctrl+f" ! #set key(find_again) "Ctrl+g" ! #set key(find_last_error) "" ! #set key(audio_on) "Ctrl+slash" ! #set key(audio_off) "Ctrl+period" ! #set key(audio_settings) "" ! #set key(midi_settings) "" ! #set key(test_audio_and_midi) "" ! #set key(load_meter) "" ! #set key(latency_meter) "" ! #set key(about) "" ! #set key(class_browser) "" ! #set key(quit) "Ctrl+q" ! #set key(close) "Ctrl+w" ! #set key(save) "Ctrl+s" ! #set key(save_as) "Ctrl+S" ! #set key(cut) "Ctrl+x" ! #set key(copy) "Ctrl+c" ! #set key(print) "Ctrl+p" ! #set key(undo) "Ctrl+z" ! #set key(redo) "Ctrl+Z" ! #set key(paste) "Ctrl+v" ! #set key(duplicate) "Ctrl+d" ! #set key(select_all) "Ctrl+a" ! #set key(text_editor) "Ctrl+t" ! #set key(font_bomb) "" ! #set key(tidy_up) "" ! #set key(reload) "Ctrl+r" ! #set key(redraw) "" ! #set key(crosshair) "" ! #set key(editmodeswitch) "Ctrl+e" ! #set key(popup_properties) "" ! #set key(popup_help) "" ! #set key(popup_open) "" ! #set key(client_class_tree) "Ctrl+grave" ! #set key(key_nav_up) "Ctrl+up" ! #set key(key_nav_down) "Ctrl+down" ! #set key(key_nav_right) "Ctrl+right" ! #set key(key_nav_left) "Ctrl+left" ! #set key(key_nav_up_shift) "Ctrl+UP" ! #set key(key_nav_down_shift) "Ctrl+DOWN" ! #set key(key_nav_right_shift) "Ctrl+RIGHT" ! #set key(key_nav_left_shift) "Ctrl+LEFT" ! #set key(key_nav_ioselect) "Ctrl+tab" ! #set key(incr_zoom) "Ctrl+equal" ! #set key(decr_zoom) "Ctrl+minus" ! ##set accels {} ! ##foreach k [array names key] {dict set accels $key($k) $k} ! ! set key(Client:Canvas) "Alt+c" ! ! set key(Canvas:Object) "Ctrl+1" ! set key(Canvas:Message) "Ctrl+2" ! set key(Canvas:Number) "Ctrl+3" ! set key(Canvas:Symbol) "Ctrl+4" ! set key(Canvas:Comment) "Ctrl+5" ! set key(Canvas:Bang) "Alt+b" ! set key(Canvas:Toggle) "Alt+t" ! set key(Canvas:Number2) "Alt+n" ! set key(Canvas:Vslider) "Alt+v" ! set key(Canvas:Hslider) "Alt+h" ! set key(Canvas:Vradio) "Alt+d" ! set key(Canvas:Hradio) "Alt+i" ! set key(Canvas:VU) "Alt+u" ! set key(Canvas:dropper) "Alt+x" ! set key(Canvas:Canvas) "Alt+c" ! set key(Canvas:Graph) "" ! set key(Canvas:Array) "" ! set key(Canvas:parentwindow) "" ! set key(Canvas:Pdwindow) "" ! set key(Canvas:new_file) "Ctrl+n" ! set key(Canvas:open_file) "Ctrl+o" ! set key(Canvas:quit) "Ctrl+q" ! set key(Canvas:find) "Ctrl+f" ! set key(Canvas:find_again) "Ctrl+g" ! set key(Canvas:find_last_error) "" ! set key(Canvas:class_browser) "" ! set key(Canvas:close) "Ctrl+w" ! set key(Canvas:save) "Ctrl+s" ! set key(Canvas:save_as) "Ctrl+S" ! set key(Canvas:cut) "Ctrl+x" ! set key(Canvas:copy) "Ctrl+c" ! set key(Canvas:print) "Ctrl+p" ! set key(Canvas:undo) "Ctrl+z" ! set key(Canvas:redo) "Ctrl+Z" ! set key(Canvas:paste) "Ctrl+v" ! set key(Canvas:duplicate) "Ctrl+d" ! set key(Canvas:select_all) "Ctrl+a" ! set key(Canvas:tidy_up) "" ! set key(Canvas:reload) "Ctrl+r" ! set key(Canvas:redraw) "" ! set key(Canvas:crosshair) "" ! set key(Canvas:editmodeswitch) "Ctrl+e" ! set key(Canvas:popup_properties) "" ! set key(Canvas:popup_help) "" ! set key(Canvas:popup_open) "" ! set key(Canvas:key_nav_up) "Ctrl+up" ! set key(Canvas:key_nav_down) "Ctrl+down" ! set key(Canvas:key_nav_right) "Ctrl+right" ! set key(Canvas:key_nav_left) "Ctrl+left" ! set key(Canvas:key_nav_up_shift) "Ctrl+UP" ! set key(Canvas:key_nav_down_shift) "Ctrl+DOWN" ! set key(Canvas:key_nav_right_shift) "Ctrl+RIGHT" ! set key(Canvas:key_nav_left_shift) "Ctrl+LEFT" ! set key(Canvas:key_nav_ioselect) "Ctrl+tab" ! set key(Canvas:incr_zoom) "Ctrl+equal" ! set key(Canvas:decr_zoom) "Ctrl+minus" ! set key(Canvas:send_message) "Ctrl+m" ! set key(Canvas:paths) "" ! set key(Canvas:text_editor) "Ctrl+t" ! set key(Canvas:font_bomb) "" ! ! set key(Client:new_file) "Ctrl+n" ! set key(Client:open_file) "Ctrl+o" ! set key(Client:pdrc_editor) "Ctrl+p" ! set key(Client:ddrc_editor) "Ctrl+l" ! set key(Client:send_message) "Ctrl+m" ! set key(Client:paths) "" ! set key(Client:quit) "Ctrl+q" ! set key(Client:find) "Ctrl+f" ! set key(Client:find_again) "Ctrl+g" ! set key(Client:find_last_error) "" ! set key(Client:audio_on) "Ctrl+slash" ! set key(Client:audio_off) "Ctrl+period" ! set key(Client:audio_settings) "" ! set key(Client:midi_settings) "" ! set key(Client:test_audio_and_midi) "" ! set key(Client:load_meter) "" ! set key(Client:latency_meter) "" ! set key(Client:about) "" ! set key(Client:class_browser) "" ! set key(Client:text_editor) "Ctrl+t" ! set key(Client:font_bomb) "" ! set key(Client:client_class_tree) "Ctrl+grave" ! set accels {} foreach k [array names key] {dict set accels $key($k) $k} *************** *** 863,867 **** foreach name $list { if {$name == ""} {$menu add separator; continue} ! if {[llength [array names key $name]]} {set k $key($name)} {set k ""} $menu add command -label [say $name] -command "$self $name" \ -accelerator [accel_munge $k] --- 952,956 ---- foreach name $list { if {$name == ""} {$menu add separator; continue} ! if {[llength [array names key $name]]} {set k $key($@_class:$name)} {set k ""} $menu add command -label [say $name] -command "$self $name" \ -accelerator [accel_munge $k] *************** *** 913,923 ****
def Menuable ctrlkey {key shift} { global accels set key [if {$shift} {string toupper $key} {string tolower $key}] ! set key "Ctrl+$key" ! if {[dict exists $accels $key]} { ! $self eval% "%W [dict get $accels $key]" ! return ! } {puts "ctrlkey: unknown $key"} }
--- 1002,1017 ----
def Menuable ctrlkey {key shift} { + puts "class:: $@_class" global accels set key [if {$shift} {string toupper $key} {string tolower $key}] ! #set key "Ctrl+$key" ! set key [$self getkey "Ctrl+$key"] ! if {[string length $key]} { ! $self eval% "%W $key" ! } else {return} ! #if {[dict exists $accels $key]} { ! # $self eval% "%W [dict get $accels $key]" ! # return ! #} {puts "ctrlkey: unknown $key"} }
*************** *** 925,933 **** global accels set key [if {$shift} {string toupper $key} {string tolower $key}] ! set key "Alt+$key" ! if {[dict exists $accels $key]} { ! $self eval% "%W [dict get $accels $key]" ! return ! } {puts "altkey: unknown $key"} }
--- 1019,1031 ---- global accels set key [if {$shift} {string toupper $key} {string tolower $key}] ! #set key "Alt+$key" ! set key [$self getkey "Alt+$key"] ! if {[string length $key]} { ! $self eval% "%W $key" ! } else {return} ! #if {[dict exists $accels $key]} { ! # $self eval% "%W [dict get $accels $key]" ! # return ! #} {puts "altkey: unknown $key"} }
*************** *** 1118,1121 **** --- 1216,1229 ---- } } + def Thing getkey {k} { + global accels + if {[dict exists $accels $k]} { + set string [dict get $accels $k] + set separator [string first : $string 0] + set class [string range $string 0 [expr $separator - 1]] + if {$class != $@_class} {return ""} else {return [string range $string [expr $separator + 1] end]} + } + } + def View init {} { super