aboutsummaryrefslogtreecommitdiff
path: root/packages/patches/keybindings_and_panels-0.41-test06.patch
blob: 82d76d4dbc021e2b111dca79eaffb88412efb20d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.28
diff -u -w -r1.28 u_main.tk
--- u_main.tk	18 Aug 2007 23:32:44 -0000	1.28
+++ u_main.tk	4 Nov 2007 20:13:46 -0000
@@ -93,28 +93,19 @@
 
 set help_top_directory $pd_guidir/doc
 
-# it's unfortunate but we seem to have to turn off global bindings
-# for Text objects to get control-s and control-t to do what we want for
-# "text" dialogs below.  Also we have to get rid of tab's changing the focus.
-
-bind all <Key-Tab> ""
-bind all <<PrevWindow>> ""
-bind Text <Control-t> {}
-bind Text <Control-s> {}
-# puts stderr [bind all]
-
 ################## set up main window #########################
 # the menus are instantiated here for the main window
 # for the patch windows, they are created by pdtk_canvas_new
 menu .mbar
-canvas .dummy -height 2p -width 6c
 
-frame .controls
-pack .controls .dummy -side top -fill x
 menu .mbar.file -tearoff $pd_tearoff
-.mbar add cascade -label "File" -menu .mbar.file
+.mbar add cascade -label File -menu .mbar.file
+menu .mbar.edit -tearoff $pd_tearoff
+.mbar add cascade -label Edit -menu .mbar.edit
+menu .mbar.put -tearoff $pd_tearoff
+.mbar add cascade -label Put -menu .mbar.put
 menu .mbar.find -tearoff $pd_tearoff
-.mbar add cascade -label "Find" -menu .mbar.find
+.mbar add cascade -label Find -menu .mbar.find
 menu .mbar.windows -postcommand [concat pdtk_fixwindowmenu] -tearoff $pd_tearoff
 menu .mbar.audio -tearoff $pd_tearoff
 if {$pd_nt != 2} {
@@ -132,11 +123,22 @@
     .mbar add cascade -label "Help" -menu .mbar.help
 }
 
+proc showhide_printouttext {state} {
+    if {$state} {
+	pack .printout -side bottom -fill both -expand 1
+    } else {
+	pack forget .printout
+    }
+}
+
 set ctrls_audio_on 0
 set ctrls_meter_on 0
 set ctrls_inlevel 0
 set ctrls_outlevel 0
+set show_text_window 0
 
+frame .controls
+pack .controls -fill x -expand 1
 frame .controls.switches
 checkbutton .controls.switches.audiobutton -text {compute audio} \
     -variable ctrls_audio_on \
@@ -148,7 +150,12 @@
     -anchor w \
     -command {pd [concat pd meters $ctrls_meter_on \;]}
 
-pack .controls.switches.audiobutton .controls.switches.meterbutton -side top
+checkbutton .controls.switches.textwindow -text {text window} \
+    -variable show_text_window \
+    -command {showhide_printouttext $show_text_window}
+
+pack .controls.switches.audiobutton .controls.switches.meterbutton \
+    .controls.switches.textwindow -side top
 
 frame .controls.inout
 frame .controls.inout.in
@@ -190,16 +197,35 @@
 
 proc pdtk_standardkeybindings {id} {
     global pd_nt
-    bind $id <Control-Key> {pdtk_pd_ctrlkey %W %K 0}
-    bind $id <Control-Shift-Key> {pdtk_pd_ctrlkey %W %K 1}
     if {$pd_nt == 2} {
         bind $id <Mod1-Key> {pdtk_canvas_ctrlkey %W %K 0}
         bind $id <Mod1-Shift-Key> {pdtk_canvas_ctrlkey %W %K 1}
+    } else {
+	bind $id <Control-Key> {pdtk_pd_ctrlkey %W %K 0}
+	bind $id <Control-Shift-Key> {pdtk_pd_ctrlkey %W %K 1}
+    }
+}
+
+proc pdtk_panelkeybindings {id panelname} {
+    global pd_nt
+    pdtk_standardkeybindings $id
+    bind $id <KeyPress-Escape> [format "%s_cancel %s" $panelname $id]
+    bind $id <KeyPress-Return> [format "%s_ok %s" $panelname $id]
+    if {$pd_nt == 2} {
+	bind $id <Mod1-Key-w> [format "%s_cancel %s" $panelname $id]
+    } else {
+	bind $id <Control-Key-w> [format "%s_cancel %s" $panelname $id]
     }
 }
 
 pdtk_standardkeybindings .
 
+if {$pd_nt == 2} {
+    bind .printout.text <Mod1-Key-a> {puts stderr ARG.printout.text}
+} else {
+    bind .printout.text <Control-Key-a> {puts stderr ARG.printout.text}
+}
+
 wm title . "Pd"
 . configure -menu .mbar -width 200 -height 150
 
@@ -331,18 +357,29 @@
 
 ################## the "Message" menu command #########################
 proc menu_send {} {
+    global pd_nt
+	destroy .sendpanel
     toplevel .sendpanel
+    pdtk_standardkeybindings .sendpanel
     entry .sendpanel.entry -textvariable send_textvariable
     pack .sendpanel.entry -side bottom -fill both -ipadx 100
     .sendpanel.entry select from 0
     .sendpanel.entry select adjust end
+    if {$pd_nt == 2} {
+	bind .sendpanel <Mod1-Key-w> {destroy .sendpanel}
+    } else {
+	bind .sendpanel <Control-Key-w> {destroy .sendpanel}
+    }
+    bind .sendpanel <KeyPress-Escape> {destroy .sendpanel}
     bind .sendpanel.entry <KeyPress-Return> {
         pd [concat $send_textvariable \;]
     }
-    pdtk_standardkeybindings .sendpanel.entry
     focus .sendpanel.entry
 }
 
+################## the "Clear Pd window" menu command #########################
+proc menu_clear_pd_window {} {.printout.text delete 0.0 end}
+
 ################## the "Quit" menu command #########################
 proc menu_really_quit {} {pd {pd quit;}}
 
@@ -416,10 +453,10 @@
 
 
 ################## help browser and support functions #########################
-proc menu_doc_browser {dir} {
-	global .mbar
-	if {![file isdirectory $dir]} {
-		puts stderr "menu_doc_browser non-directory $dir\n"
+proc menu_doc_browser {} {
+    global .mbar pd_nt help_top_directory
+    if {![file isdirectory $help_top_directory]} {
+		puts stderr "menu_doc_browser non-directory $help_top_directory\n"
 	}
 	if { [winfo exists .help_browser.frame] } {
 		raise .help_browser
@@ -428,7 +465,13 @@
 		wm title .help_browser "Pd Documentation Browser"
 		frame .help_browser.frame
 		pack .help_browser.frame -side top -fill both
-		doc_make_listbox .help_browser.frame $dir 0
+	pdtk_standardkeybindings .help_browser
+	if {$pd_nt == 2} {
+	    bind .help_browser <Mod1-Key-w> {destroy .help_browser}
+	} else {
+	    bind .help_browser <Control-Key-w> {destroy .help_browser}
+	}
+	doc_make_listbox .help_browser.frame $help_top_directory 0
          }
     }
 
@@ -549,7 +592,8 @@
     $mbar.help add command -label {Html ...} \
         -command {menu_doc_open doc/1.manual index.htm} 
     $mbar.help add command -label {Browser ...} \
-        -command {menu_doc_browser $help_top_directory} 
+        -accelerator [accel_munge "Ctrl+b"] \
+        -command {menu_doc_browser} 
 }
 
 #################### the "File" menu for the Pd window ##############
@@ -573,7 +617,52 @@
 .mbar.file add command -label Quit -command {menu_quit} \
     -accelerator [accel_munge "Ctrl+q"]
 
+
+#################### the "Edit" menu for the Pd window ##############
+# this is mostly a placeholder
+.mbar.edit add command -label Undo -accelerator [accel_munge "Ctrl+z"] \
+	 -state disabled
+.mbar.edit add command -label Redo -accelerator [accel_munge "Ctrl+Z"] \
+	 -state disabled
+.mbar.edit add separator
+# this should apply to .printout.text
+.mbar.edit add command -label Cut  -accelerator [accel_munge "Ctrl+x"] \
+	 -state disabled
+# this should apply to .printout.text
+.mbar.edit add command -label Copy -accelerator [accel_munge "Ctrl+c"] \
+	 -state disabled
+.mbar.edit add command -label Paste -accelerator [accel_munge "Ctrl+v"] \
+	 -state disabled
+.mbar.edit add command -label Duplicate -accelerator [accel_munge "Ctrl+d"] \
+	 -state disabled
+# this should apply to .printout.text
+.mbar.edit add command -label {Select all} -accelerator [accel_munge "Ctrl+a"] \
+	 -state disabled 
+.mbar.edit add separator
+.mbar.edit add command -label {Text Editor} \
+    -accelerator "Ctrl-T" -state disabled
+.mbar.edit add command -label Font -state disabled
+.mbar.edit add command -label {Tidy Up} -state disabled
+.mbar.edit add command -label {Clear Pd window} \
+	 -accelerator [accel_munge "Ctrl+r"] -command menu_clear_pd_window
+.mbar.edit add separator
+# this should apply to .printout.text
+.mbar.edit add command -label {Find...} -accelerator [accel_munge "Ctrl+f"] \
+	 -state disabled
+# this should apply to .printout.text
+.mbar.edit add command -label {Find Again} -accelerator [accel_munge "Ctrl+g"] \
+	 -state disabled
+.mbar.edit add command -label {Find last error}
+.mbar.edit add separator
+.mbar.edit add command -label {Edit mode} -accelerator [accel_munge "Ctrl+e"] \
+	 -state disabled
+
 #################### the "Find" menu for the Pd window ##############
+
+.mbar.find add command -label Find -accelerator [accel_munge "Ctrl+f"] \
+	 -state disabled
+.mbar.find add command -label {Find Again} -accelerator [accel_munge "Ctrl+g"] \
+	 -state disabled
 .mbar.find add command -label {Find last error} -command {menu_finderror} 
 
 ###########  functions for menu functions on document windows ########
@@ -802,7 +891,7 @@
 set find_string ""
 set find_count 1
 
-proc find_apply {name} {
+proc find_ok {name} {
     global find_string
     global find_canvas
     regsub -all \; $find_string " _semi_ " find_string2
@@ -830,6 +919,9 @@
     
     toplevel $name
 
+    #bind $name <FocusIn> "puts stderr \"bind focus $name.entry\""
+    pdtk_panelkeybindings $name "find"
+
     label $name.label -text {find...}
     pack $name.label -side top
 
@@ -841,15 +933,15 @@
     button $name.buttonframe.cancel -text {Cancel}\
         -command "find_cancel $name"
     button $name.buttonframe.ok -text {OK}\
-        -command "find_apply $name"
+        -command "find_ok $name"
     pack $name.buttonframe.cancel -side left -expand 1
     pack $name.buttonframe.ok -side left -expand 1
     
     $name.entry select from 0
     $name.entry select adjust end
-    bind $name.entry <KeyPress-Return> [ concat find_apply $name]
-    pdtk_standardkeybindings $name.entry
+    #puts stderr "before focus $name.entry"
     focus $name.entry
+    #puts stderr "after focus $name.entry"
 }
 
 
@@ -974,7 +1066,7 @@
 
     $name.m.edit add command -label {Text Editor} \
         -command [concat menu_texteditor $name] \
-        -accelerator [accel_munge "Ctrl+t"]
+        -accelerator "Ctrl-T"
 
     $name.m.edit add command -label Font \
         -command [concat menu_font $name] 
@@ -982,6 +1074,10 @@
     $name.m.edit add command -label {Tidy Up} \
         -command [concat menu_tidyup $name]
 
+    $name.m.edit add command -label {Clear Pd window} \
+		  -accelerator [accel_munge "Ctrl+r"] \
+        -command [concat menu_clear_pd_window]
+
     $name.m.edit add separator
     
 # Apple, Microsoft, and others put find functions in the Edit menu.
@@ -1006,7 +1102,8 @@
         -accelerator [accel_munge "Ctrl+e"]     
 
     if { $editable == 0 } {
-            $name.m.edit entryconfigure "Edit mode" -indicatoron false }
+            $name.m.edit entryconfigure "Edit mode" -indicatoron false 
+	 }
 
         
 ############iemlib##################
@@ -1616,11 +1713,13 @@
         if {$key == "q" || $key == "Q"} {menu_quit}
         if {$key == "s" || $key == "S"} {menu_save $topname}
         if {$key == "z" || $key == "Z"} {menu_undo $topname}
+            if {$key == "b" || $key == "B"} {menu_doc_browser}
         if {$key == "n" || $key == "N"} {menu_new}
         if {$key == "o" || $key == "O"} {menu_open}
         if {$key == "m" || $key == "M"} {menu_send}
         if {$key == "w" || $key == "W"} {menu_close $topname}
         if {$key == "p" || $key == "P"} {menu_print $topname}
+            if {$key == "r" || $key == "R"} {menu_clear_pd_window}
         if {$key == "x" || $key == "X"} {menu_cut $topname}
         if {$key == "c" || $key == "C"} {menu_copy $topname}
         if {$key == "v" || $key == "V"} {menu_paste $topname}
@@ -1704,28 +1803,42 @@
 ############ pdtk_canvas_dofont -- run a font and resize dialog #########
 
 set fontsize 0
+set dofont_fontsize 0
 set stretchval 0
 set whichstretch 0
 
-proc dofont_apply {name} {
-    global fontsize
+proc dofont_apply {name myfontsize} {
     global stretchval
     global whichstretch
-    set cmd [concat $name font $fontsize $stretchval $whichstretch \;]
+    set cmd [concat $name font $myfontsize $stretchval $whichstretch \;]
+#    puts stderr $cmd
+    pd $cmd
+}
+
+proc dofont_close {name} {
+    set cmd [concat $name cancel \;]
 #    puts stderr $cmd
     pd $cmd
 }
 
 proc dofont_cancel {name} {
+    global fontsize
+    dofont_apply $name $fontsize
     set cmd [concat $name cancel \;]
 #    puts stderr $cmd
     pd $cmd
 }
 
+proc dofont_ok {name} {
+    global fontsize dofont_fontsize
+    set fontsize $dofont_fontsize
+    dofont_apply $name $fontsize
+    dofont_close $name
+}
+
 proc pdtk_canvas_dofont {name initsize} {
     
-    global fontsize
-    set fontsize $initsize
+    global dofont_fontsize
     
     global stretchval
     set stretchval 100
@@ -1737,12 +1850,14 @@
     wm title $name  {FONT BOMB}
     wm protocol $name WM_DELETE_WINDOW [concat dofont_cancel $name]
 
+    pdtk_panelkeybindings $name dofont
+    
     frame $name.buttonframe
     pack $name.buttonframe -side bottom -fill x -pady 2m
     button $name.buttonframe.cancel -text {Cancel}\
         -command "dofont_cancel $name"
-    button $name.buttonframe.ok -text {Do it}\
-        -command "dofont_apply $name"
+    button $name.buttonframe.ok -text {OK}\
+        -command "dofont_ok $name"
     pack $name.buttonframe.cancel -side left -expand 1
     pack $name.buttonframe.ok -side left -expand 1
     
@@ -1752,12 +1867,18 @@
     label $name.radiof.label -text {Font Size:}
     pack $name.radiof.label -side top
 
-    radiobutton $name.radiof.radio8 -value 8 -variable fontsize -text "8"
-    radiobutton $name.radiof.radio10 -value 10 -variable fontsize -text "10"
-    radiobutton $name.radiof.radio12 -value 12 -variable fontsize -text "12"
-    radiobutton $name.radiof.radio16 -value 16 -variable fontsize -text "16"
-    radiobutton $name.radiof.radio24 -value 24 -variable fontsize -text "24"
-    radiobutton $name.radiof.radio36 -value 36 -variable fontsize -text "36"
+    radiobutton $name.radiof.radio8 -value 8 -variable dofont_fontsize -text "8" \
+    -command [concat dofont_apply $name 8]
+    radiobutton $name.radiof.radio10 -value 10 -variable dofont_fontsize -text "10" \
+    -command [concat dofont_apply $name 10]
+    radiobutton $name.radiof.radio12 -value 12 -variable dofont_fontsize -text "12" \
+    -command [concat dofont_apply $name 12]
+    radiobutton $name.radiof.radio16 -value 16 -variable dofont_fontsize -text "16" \
+    -command [concat dofont_apply $name 16]
+    radiobutton $name.radiof.radio24 -value 24 -variable dofont_fontsize -text "24" \
+    -command [concat dofont_apply $name 24]
+    radiobutton $name.radiof.radio36 -value 36 -variable dofont_fontsize -text "36" \
+    -command [concat dofont_apply $name 36]
     pack $name.radiof.radio8 -side top -anchor w
     pack $name.radiof.radio10 -side top -anchor w
     pack $name.radiof.radio12 -side top -anchor w
@@ -1902,6 +2023,8 @@
     wm title $id {Atom}
     wm protocol $id WM_DELETE_WINDOW [concat dogatom_cancel $id]
 
+    pdtk_panelkeybindings $id "dogatom"
+
     frame $id.buttonframe
     pack $id.buttonframe -side bottom -fill x -pady 2m
     button $id.buttonframe.cancel -text {Cancel}\
@@ -1973,14 +2096,6 @@
     entry $id.params.entry -textvariable $var_gatomwidth -width 4
     pack $id.params.entryname $id.params.entry -side left
 
-
-
-    bind $id.paramhi.entry <KeyPress-Return> [concat dogatom_ok $id]
-    bind $id.paramlo.entry <KeyPress-Return> [concat dogatom_ok $id]
-    bind $id.params.entry <KeyPress-Return> [concat dogatom_ok $id]
-    pdtk_standardkeybindings $id.paramhi.entry
-    pdtk_standardkeybindings $id.paramlo.entry
-    pdtk_standardkeybindings $id.params.entry
     $id.params.entry select from 0
     $id.params.entry select adjust end
     focus $id.params.entry
@@ -2489,6 +2604,8 @@
     wm title $id [format "%s-PROPERTIES" $mainheader]
     wm protocol $id WM_DELETE_WINDOW [concat iemgui_cancel $id]
     
+    pdtk_panelkeybindings $id "iemgui"
+
     frame $id.dim
     pack $id.dim -side top
     label $id.dim.head -text $dim_header
@@ -2708,31 +2825,6 @@
         bind $id <<PrevWindow>> {tk::TabToWindow [tk_focusPrev %W]}
     }
     
-    bind $id.dim.w_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.dim.h_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.rng.min_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.rng.max_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.para.num_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.snd.ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.rcv.ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.gnam.ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.gnxy.x_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.gnxy.y_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.gnfs.fs_ent <KeyPress-Return> [concat iemgui_ok $id]
-    bind $id.cao.ok <KeyPress-Return> [concat iemgui_ok $id]
-    pdtk_standardkeybindings $id.dim.w_ent
-    pdtk_standardkeybindings $id.dim.h_ent
-    pdtk_standardkeybindings $id.rng.min_ent
-    pdtk_standardkeybindings $id.rng.max_ent
-    pdtk_standardkeybindings $id.para.num_ent
-    pdtk_standardkeybindings $id.snd.ent
-    pdtk_standardkeybindings $id.rcv.ent
-    pdtk_standardkeybindings $id.gnam.ent
-    pdtk_standardkeybindings $id.gnxy.x_ent
-    pdtk_standardkeybindings $id.gnxy.y_ent
-    pdtk_standardkeybindings $id.gnfs.fs_ent
-    pdtk_standardkeybindings $id.cao.ok
-    
     $id.dim.w_ent select from 0
     $id.dim.w_ent select adjust end
     focus $id.dim.w_ent
@@ -2810,6 +2902,8 @@
     wm title $id {array}
     wm protocol $id WM_DELETE_WINDOW [concat array_cancel $id]
 
+    pdtk_panelkeybindings $id "array"
+
     frame $id.name
     pack $id.name -side top
     label $id.name.label -text "name"
@@ -2876,10 +2970,6 @@
     if {$newone == 0} {pack $id.buttonframe.apply -side left -expand 1}
     pack $id.buttonframe.ok -side left -expand 1
     
-    bind $id.name.entry <KeyPress-Return> [concat array_ok $id]
-    bind $id.n.entry <KeyPress-Return> [concat array_ok $id]
-    pdtk_standardkeybindings $id.name.entry
-    pdtk_standardkeybindings $id.n.entry
     $id.name.entry select from 0
     $id.name.entry select adjust end
     focus $id.name.entry
@@ -3070,6 +3160,8 @@
     wm title $id {canvas}
     wm protocol $id WM_DELETE_WINDOW [concat canvas_cancel $id]
 
+    pdtk_panelkeybindings $id "canvas"
+
     label $id.toplabel -text "Canvas Properties"
     pack $id.toplabel -side top
     
@@ -3139,10 +3231,6 @@
     pack $id.buttonframe.apply -side left -expand 1
     pack $id.buttonframe.ok -side left -expand 1
 
-    bind $id.xscale.entry <KeyPress-Return> [concat canvas_ok $id]
-    bind $id.yscale.entry <KeyPress-Return> [concat canvas_ok $id]
-    pdtk_standardkeybindings $id.xscale.entry
-    pdtk_standardkeybindings $id.yscale.entry
     $id.xscale.entry select from 0
     $id.xscale.entry select adjust end
     focus $id.xscale.entry
@@ -3182,6 +3270,10 @@
     wm title $name {Atom}
     wm protocol $name WM_DELETE_WINDOW [concat dodata_cancel $name]
 
+    pdtk_panelkeybindings $name "dodata"
+    bind $name <Control-t> [concat dodata_ok $name]
+    bind $name <Control-s> [concat dodata_send $name]
+
     frame $name.buttonframe
     pack $name.buttonframe -side bottom -fill x -pady 2m
     button $name.buttonframe.send -text {Send (Ctrl s)}\
@@ -3198,8 +3290,6 @@
     pack $name.text -side left -fill both -expand 1
     $name.text insert end $stuff
     focus $name.text
-    bind $name.text <Control-t> [concat dodata_ok $name]
-    bind $name.text <Control-s> [concat dodata_send $name]
 }
 
 ############ check or uncheck the "edit" menu item ##############
@@ -3375,6 +3465,10 @@
     toplevel $name
     wm title $name {TEXT}
 
+    pdtk_standardkeybindings $name
+    bind $name <Control-t> {texteditor_ok %W}
+    bind $name <Control-s> {texteditor_send %W}
+
     frame $name.buttons
     pack $name.buttons -side bottom -fill x -pady 2m
     button $name.buttons.send -text {Send (Ctrl s)}\
@@ -3391,8 +3485,6 @@
     pack $name.text -side left -fill both -expand 1
     $name.text insert end $stuff
     focus $name.text
-    bind $name.text <Control-t> {texteditor_ok %W}
-    bind $name.text <Control-s> {texteditor_send %W}
 }
 
 #  paste text into a text box
@@ -3591,6 +3683,8 @@
     wm title $id {audio}
     wm protocol $id WM_DELETE_WINDOW [concat audio_cancel $id]
 
+    pdtk_panelkeybindings $id "audio"
+
     frame $id.buttonframe
     pack $id.buttonframe -side bottom -fill x -pady 2m
     button $id.buttonframe.cancel -text {Cancel}\
@@ -3752,17 +3846,9 @@
             -command  {pd pd audio-properties 1 \;}
         pack $id.longbutton.b
     }
-    bind $id.srf.x1 <KeyPress-Return> [concat audio_ok $id]
-    bind $id.srf.x2 <KeyPress-Return> [concat audio_ok $id]
-    bind $id.in1f.x2 <KeyPress-Return> [concat audio_ok $id]
-    bind $id.out1f.x2 <KeyPress-Return> [concat audio_ok $id]
     $id.srf.x1 select from 0
     $id.srf.x1 select adjust end
     focus $id.srf.x1
-    pdtk_standardkeybindings $id.srf.x1
-    pdtk_standardkeybindings $id.srf.x2
-    pdtk_standardkeybindings $id.in1f.x2
-    pdtk_standardkeybindings $id.out1f.x2
 }
 
 ####################### midi dialog ##################
@@ -3841,6 +3927,8 @@
     wm title $id {midi}
     wm protocol $id WM_DELETE_WINDOW [concat midi_cancel $id]
 
+    pdtk_panelkeybindings $id "midi"
+
     frame $id.buttonframe
     pack $id.buttonframe -side bottom -fill x -pady 2m
     button $id.buttonframe.cancel -text {Cancel}\
@@ -3975,6 +4063,8 @@
     wm title $id {midi}
     wm protocol $id WM_DELETE_WINDOW [concat midi_cancel $id]
 
+    pdtk_panelkeybindings $id "midi"
+
     frame $id.buttonframe
     pack $id.buttonframe -side bottom -fill x -pady 2m
     button $id.buttonframe.cancel -text {Cancel}\
@@ -4132,6 +4222,8 @@
     wm title $id {PD search path for patches and other files}
     wm protocol $id WM_DELETE_WINDOW [concat path_cancel $id]
 
+    pdtk_panelkeybindings $id "path"
+
     frame $id.buttonframe
     pack $id.buttonframe -side bottom -fill x -pady 2m
     button $id.buttonframe.cancel -text {Cancel}\
@@ -4157,8 +4249,6 @@
     
     for {set x 0} {$x < 10} {incr x} {
         entry $id.f$x -textvariable pd_path$x -width 80
-        bind $id.f$x <KeyPress-Return> [concat path_ok $id]
-        pdtk_standardkeybindings $id.f$x
         pack $id.f$x -side top
     }
 
@@ -4206,6 +4296,8 @@
     wm title $id {Pd binaries to load (on next startup)}
     wm protocol $id WM_DELETE_WINDOW [concat startup_cancel $id]
 
+    pdtk_panelkeybindings $id "startup"
+
     frame $id.buttonframe
     pack $id.buttonframe -side bottom -fill x -pady 2m
     button $id.buttonframe.cancel -text {Cancel}\
@@ -4222,8 +4314,6 @@
     pack $id.flags -side bottom
     label $id.flags.entryname -text {startup flags}
     entry $id.flags.entry -textvariable pd_flags -width 80
-    bind $id.flags.entry <KeyPress-Return> [concat startup_ok $id]
-    pdtk_standardkeybindings $id.flags.entry
     pack $id.flags.entryname $id.flags.entry -side left
 
     frame $id.nortframe
@@ -4242,8 +4332,6 @@
 
     for {set x 0} {$x < 10} {incr x} {
         entry $id.f$x -textvariable pd_startup$x -width 80
-        bind $id.f$x <KeyPress-Return> [concat startup_ok $id]
-        pdtk_standardkeybindings $id.f$x
         pack $id.f$x -side top
     }