From 588bea57f4153b3e0f047ccc2bdd9200bb9b675e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 16 Apr 2013 21:15:35 +0000 Subject: allow to only disable the quit bindings Ctrl-W/Ctrl-Q and the shift-variants svn path=/trunk/guiplugins/kiosk-plugin/; revision=17093 --- kiosk-plugin.tcl | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/kiosk-plugin.tcl b/kiosk-plugin.tcl index 9edb72b..0f72cc3 100644 --- a/kiosk-plugin.tcl +++ b/kiosk-plugin.tcl @@ -26,6 +26,7 @@ set ::kiosk::config(ScrollBars) False set ::kiosk::config(QuitOnClose) True set ::kiosk::config(PreventClose) True set ::kiosk::config(Bindings) False +set ::kiosk::config(QuitBinding) True @@ -62,10 +63,8 @@ menu .kioskmenu proc ::kiosk::makekiosk {mywin} { ## refuse to kioskify the main Pd window if { $mywin == ".pdwindow" } { return; } +# puts "KIOSKing $mywin" - puts "KIOSKing $mywin" - -#puts "makekiosk $mywin" #remove menu if { $::kiosk::config(ShowMenu) } { } { $mywin configure -menu .kioskmenu; @@ -94,10 +93,22 @@ proc ::kiosk::makekiosk {mywin} { } } + set mycnv [tkcanvas_name $mywin ] + +# remove all special key/mouse bindings from the window + if { $::kiosk::config(QuitBinding) } { } { + bind $mycnv {} + bind $mycnv {} + bind all {} + bind all {} + + bind $mycnv {} + bind $mycnv {} + bind all {} + bind all {} + } # remove all special key/mouse bindings from the window if { $::kiosk::config(Bindings) } { } { -puts "prevent bindings" - set mycnv [tkcanvas_name $mywin ] bindtags $mywin "" bindtags $mycnv "$mycnv" # rebind ordinary keypress events @@ -144,5 +155,5 @@ if { $::kiosk::config(KioskNewWindow) } { } -pdtk_post "loaded: kiosk-plugin 0.1\n" +pdtk_post "loaded: kiosk-plugin 0.2\n" -- cgit v1.2.1