diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-21 16:04:20 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-21 16:04:20 (GMT) |
commit | 60185fa162e07e3ffb2351e26b1946570633487a (patch) | |
tree | 5604c1f6df6ec3460b9a634d928ccfb58d559bb0 /library/tk.tcl | |
parent | 4ff12b5ba2d676f45815ea946d632c63c925083d (diff) | |
parent | 6c408f9635216a7ef5b45abb0084de2b648bd77a (diff) | |
download | tk-60185fa162e07e3ffb2351e26b1946570633487a.zip tk-60185fa162e07e3ffb2351e26b1946570633487a.tar.gz tk-60185fa162e07e3ffb2351e26b1946570633487a.tar.bz2 |
Merge trunk
Diffstat (limited to 'library/tk.tcl')
-rw-r--r-- | library/tk.tcl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/library/tk.tcl b/library/tk.tcl index 07ca5be..9328820 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -366,15 +366,16 @@ if {![llength [info command tk_chooseDirectory]]} { # Define the set of common virtual events. #---------------------------------------------------------------------- +event add <<ContextMenu>> <Button-3> +event add <<PasteSelection>> <ButtonRelease-2> + switch -exact -- [tk windowingsystem] { "x11" { event add <<Cut>> <Control-x> <F20> <Control-Lock-X> event add <<Copy>> <Control-c> <F16> <Control-Lock-C> event add <<Paste>> <Control-v> <F18> <Control-Lock-V> - event add <<PasteSelection>> <ButtonRelease-2> event add <<Undo>> <Control-z> <Control-Lock-Z> event add <<Redo>> <Control-Z> <Control-Lock-z> - event add <<ContextMenu>> <Button-3> # On Darwin/Aqua, buttons from left to right are 1,3,2. On Darwin/X11 with recent # XQuartz as the X server, they are 1,2,3; other X servers may differ. @@ -422,10 +423,8 @@ switch -exact -- [tk windowingsystem] { event add <<Cut>> <Control-x> <Shift-Delete> <Control-Lock-X> event add <<Copy>> <Control-c> <Control-Insert> <Control-Lock-C> event add <<Paste>> <Control-v> <Shift-Insert> <Control-Lock-V> - event add <<PasteSelection>> <ButtonRelease-2> event add <<Undo>> <Control-z> <Control-Lock-Z> event add <<Redo>> <Control-y> <Control-Lock-Y> - event add <<ContextMenu>> <Button-3> event add <<SelectAll>> <Control-slash> <Control-a> <Control-Lock-A> event add <<SelectNone>> <Control-backslash> @@ -455,9 +454,7 @@ switch -exact -- [tk windowingsystem] { event add <<Cut>> <Command-x> <F2> <Command-Lock-X> event add <<Copy>> <Command-c> <F3> <Command-Lock-C> event add <<Paste>> <Command-v> <F4> <Command-Lock-V> - event add <<PasteSelection>> <ButtonRelease-3> event add <<Clear>> <Clear> - event add <<ContextMenu>> <Button-2> # Official bindings # See http://support.apple.com/kb/HT1343 @@ -537,6 +534,13 @@ proc ::tk::CancelRepeat {} { set Priv(afterId) {} } +## ::tk::MouseWheel $w $dir $amount $factor $units + +proc ::tk::MouseWheel {w dir amount {factor -120.0} {units units}} { + $w ${dir}view scroll [expr {$amount/$factor}] $units +} + + # ::tk::TabToWindow -- # This procedure moves the focus to the given widget. # It sends a <<TraverseOut>> virtual event to the previous focus window, |