aboutsummaryrefslogtreecommitdiff
path: root/kiosk-plugin.tcl
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2013-04-16 21:15:35 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2013-04-16 21:15:35 +0000
commit588bea57f4153b3e0f047ccc2bdd9200bb9b675e (patch)
treeda4746ac0870eda0659ac8494b7e29fe5f42c271 /kiosk-plugin.tcl
parent57bb9e3ee81ca718ad25deaec9ee87adbe73553a (diff)
allow to only disable the quit bindings
Ctrl-W/Ctrl-Q and the shift-variants svn path=/trunk/guiplugins/kiosk-plugin/; revision=17093
Diffstat (limited to 'kiosk-plugin.tcl')
-rw-r--r--kiosk-plugin.tcl23
1 files 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 <Control-Key-w> {}
+ bind $mycnv <Control-Shift-Key-W> {}
+ bind all <Control-Key-w> {}
+ bind all <Control-Shift-Key-W> {}
+
+ bind $mycnv <Control-Key-q> {}
+ bind $mycnv <Control-Shift-Key-Q> {}
+ bind all <Control-Key-q> {}
+ bind all <Control-Shift-Key-Q> {}
+ }
# 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"