diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-10 10:20:50 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-10 10:20:50 (GMT) |
commit | b7a61d63d4aabbd30586eea219f7402f3da61ac6 (patch) | |
tree | 6270ad7be676303bb66e0b80674b1aba64a0b72b /library | |
parent | 37ceb5fe2eba6473a2fbdb5407e449ef96345a43 (diff) | |
download | tk-b7a61d63d4aabbd30586eea219f7402f3da61ac6.zip tk-b7a61d63d4aabbd30586eea219f7402f3da61ac6.tar.gz tk-b7a61d63d4aabbd30586eea219f7402f3da61ac6.tar.bz2 |
define two more virtual bindings, and correct various Mac
bindings according to Apple OSX documentation.
Doc updated as well
Diffstat (limited to 'library')
-rw-r--r-- | library/entry.tcl | 4 | ||||
-rw-r--r-- | library/listbox.tcl | 4 | ||||
-rw-r--r-- | library/spinbox.tcl | 4 | ||||
-rw-r--r-- | library/text.tcl | 4 | ||||
-rw-r--r-- | library/tk.tcl | 77 | ||||
-rw-r--r-- | library/ttk/entry.tcl | 4 |
6 files changed, 50 insertions, 47 deletions
diff --git a/library/entry.tcl b/library/entry.tcl index 026363c..f28547e 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -185,10 +185,10 @@ bind Entry <Control-Shift-space> { bind Entry <Shift-Select> { %W selection adjust insert } -bind Entry <Control-slash> { +bind Entry <<SelectAll>> { %W selection range 0 end } -bind Entry <Control-backslash> { +bind Entry <<SelectNone>> { %W selection clear } bind Entry <KeyPress> { diff --git a/library/listbox.tcl b/library/listbox.tcl index 2715385..31d0fbb 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -154,10 +154,10 @@ bind Listbox <Shift-Select> { bind Listbox <Escape> { tk::ListboxCancel %W } -bind Listbox <Control-slash> { +bind Listbox <<SelectAll>> { tk::ListboxSelectAll %W } -bind Listbox <Control-backslash> { +bind Listbox <<SelectNone>> { if {[%W cget -selectmode] ne "browse"} { %W selection clear 0 end event generate %W <<ListboxSelect>> diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 54d8fe6..06c002c 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -193,10 +193,10 @@ bind Spinbox <Control-Shift-space> { bind Spinbox <Shift-Select> { %W selection adjust insert } -bind Spinbox <Control-slash> { +bind Spinbox <<SelectAll>> { %W selection range 0 end } -bind Spinbox <Control-backslash> { +bind Spinbox <<SelectNone>> { %W selection clear } bind Spinbox <KeyPress> { diff --git a/library/text.tcl b/library/text.tcl index 94bb223..e59a86e 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -240,10 +240,10 @@ bind Text <Shift-Select> { set tk::Priv(selectMode) char tk::TextKeyExtend %W insert } -bind Text <Control-slash> { +bind Text <<SelectAll>> { %W tag add sel 1.0 end } -bind Text <Control-backslash> { +bind Text <<SelectNone>> { %W tag remove sel 1.0 end } bind Text <<Cut>> { diff --git a/library/tk.tcl b/library/tk.tcl index b810dc6..8a0e3ff 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -362,17 +362,19 @@ if {![llength [info command tk_chooseDirectory]]} { switch -exact -- [tk windowingsystem] { "x11" { - event add <<Cut>> <Control-Key-x> <Key-F20> <Control-Lock-Key-X> - event add <<Copy>> <Control-Key-c> <Key-F16> <Control-Lock-Key-C> - event add <<Paste>> <Control-Key-v> <Key-F18> <Control-Lock-Key-V> - event add <<PasteSelection>> <ButtonRelease-2> - event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> - event add <<Redo>> <Control-Key-Z> <Control-Lock-Key-z> - event add <<ContextMenu>> <Button-3> + event add <<Cut>> <Control-Key-x> <Key-F20> <Control-Lock-Key-X> + event add <<Copy>> <Control-Key-c> <Key-F16> <Control-Lock-Key-C> + event add <<Paste>> <Control-Key-v> <Key-F18> <Control-Lock-Key-V> + event add <<PasteSelection>> <ButtonRelease-2> + event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> + event add <<Redo>> <Control-Key-Z> <Control-Lock-Key-z> + event add <<ContextMenu>> <Button-3> if {[info exists tcl_platform(os)] && $tcl_platform(os) eq "Darwin"} { - event add <<ContextMenu>> <Button-2> + event add <<ContextMenu>> <Button-2> } + event add <<SelectAll>> <Control-Key-slash> + event add <<SelectNone>> <Control-Key-backslash> event add <<NextChar>> <Right> event add <<SelectNextChar>> <Shift-Right> event add <<PrevChar>> <Left> @@ -411,17 +413,16 @@ switch -exact -- [tk windowingsystem] { set ::tk::AlwaysShowSelection 1 } "win32" { - event add <<Cut>> <Control-Key-x> <Shift-Key-Delete> \ - <Control-Lock-Key-X> - event add <<Copy>> <Control-Key-c> <Control-Key-Insert> \ - <Control-Lock-Key-C> - event add <<Paste>> <Control-Key-v> <Shift-Key-Insert> \ - <Control-Lock-Key-V> - event add <<PasteSelection>> <ButtonRelease-2> - event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> - event add <<Redo>> <Control-Key-y> <Control-Lock-Key-Y> - event add <<ContextMenu>> <Button-3> - + event add <<Cut>> <Control-Key-x> <Shift-Key-Delete> <Control-Lock-Key-X> + event add <<Copy>> <Control-Key-c> <Control-Key-Insert> <Control-Lock-Key-C> + event add <<Paste>> <Control-Key-v> <Shift-Key-Insert> <Control-Lock-Key-V> + event add <<PasteSelection>> <ButtonRelease-2> + event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> + event add <<Redo>> <Control-Key-y> <Control-Lock-Key-Y> + event add <<ContextMenu>> <Button-3> + + event add <<SelectAll>> <Control-Key-slash> + event add <<SelectNone>> <Control-Key-backslash> event add <<NextChar>> <Right> event add <<SelectNextChar>> <Shift-Right> event add <<PrevChar>> <Left> @@ -444,35 +445,37 @@ switch -exact -- [tk windowingsystem] { event add <<SelectPrevPara>> <Shift-Control-Down> } "aqua" { - event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X> - event add <<Copy>> <Command-Key-c> <Key-F3> <Control-Lock-Key-C> - event add <<Paste>> <Command-Key-v> <Key-F4> <Control-Lock-Key-V> - event add <<PasteSelection>> <ButtonRelease-2> - event add <<Clear>> <Clear> - event add <<Undo>> <Command-Key-z> <Control-Lock-Key-Z> - event add <<Redo>> <Command-Key-y> <Control-Lock-Key-Y> - event add <<ContextMenu>> <Button-2> + event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X> + event add <<Copy>> <Command-Key-c> <Key-F3> <Control-Lock-Key-C> + event add <<Paste>> <Command-Key-v> <Key-F4> <Control-Lock-Key-V> + event add <<PasteSelection>> <ButtonRelease-2> + event add <<Clear>> <Clear> + event add <<ContextMenu>> <Button-2> # Official bindings # See http://support.apple.com/kb/HT1343 - event add <<NextChar>> <Right> + event add <<SelectAll>> <Command-Key-a> + event add <<SelectNone>> <Option-Command-Key-a> + event add <<Undo>> <Command-Key-z> <Control-Lock-Key-Z> + event add <<Redo>> <Command-Key-Z> <Control-Lock-Key-z> + event add <<NextChar>> <Right> <Control-Key-f> <Control-Lock-Key-F> event add <<SelectNextChar>> <Shift-Right> - event add <<PrevChar>> <Left> + event add <<PrevChar>> <Left> <Control-Key-b> <Control-Lock-Key-B> event add <<SelectPrevChar>> <Shift-Left> event add <<NextWord>> <Option-Right> event add <<SelectNextWord>> <Shift-Option-Right> event add <<PrevWord>> <Option-Left> event add <<SelectPrevWord>> <Shift-Option-Left> - event add <<SelectLineStart>> <Shift-Home> <Shift-Command-Left> - event add <<SelectLineEnd>> <Shift-End> <Shift-Command-Right> + event add <<LineStart>> <Home> <Command-Left> <Control-Key-a> <Control-Lock-Key-A> + event add <<SelectLineStart>> <Shift-Home> <Shift-Command-Left> <Control-Key-A> <Control-Lock-Key-a> + event add <<LineEnd>> <End> <Command-Right> <Control-Key-e> <Control-Lock-Key-E> + event add <<SelectLineEnd>> <Shift-End> <Shift-Command-Right> <Control-Key-E> <Control-Lock-Key-e> + event add <<PrevLine>> <Up> <Control-Key-p> <Control-Lock-Key-P> + event add <<SelectPrevLine>> <Shift-Up> <Control-Key-P> <Control-Lock-Key-p> + event add <<NextLine>> <Down> <Control-Key-n> <Control-Lock-Key-N> + event add <<SelectNextLine>> <Shift-Down> <Control-Key-N> <Control-Lock-Key-n> # Not official, but logical extensions of above. Also derived from # bindings present in MS Word on OSX. - event add <<LineStart>> <Home> <Command-Left> <Command-Key-a> <Control-Lock-Key-A> - event add <<LineEnd>> <End> <Command-Right> <Command-Key-e> <Control-Lock-Key-E> - event add <<PrevLine>> <Up> - event add <<NextLine>> <Down> - event add <<SelectPrevLine>> <Shift-Up> - event add <<SelectNextLine>> <Shift-Down> event add <<PrevPara>> <Option-Up> event add <<NextPara>> <Option-Down> event add <<SelectPrevPara>> <Shift-Option-Up> diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index dc835e9..22c4115 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -107,8 +107,8 @@ bind TEntry <<SelectNextWord>> { ttk::entry::Extend %W nextword } bind TEntry <<SelectLineStart>> { ttk::entry::Extend %W home } bind TEntry <<SelectLineEnd>> { ttk::entry::Extend %W end } -bind TEntry <Control-Key-slash> { %W selection range 0 end } -bind TEntry <Control-Key-backslash> { %W selection clear } +bind TEntry <<SelectAll>> { %W selection range 0 end } +bind TEntry <<SelectNone>> { %W selection clear } bind TEntry <<TraverseIn>> { %W selection range 0 end; %W icursor end } |