/opt/imh/python3.13/lib/tk8.6
NameSizeModeActions
demos/-0755rm
images/-0755rm
msgs/-0755rm
ttk/-0755rm
bgerror.tcl85340644editdlrm
button.tcl208300644editdlrm
choosedir.tcl96990644editdlrm
clrpick.tcl213450644editdlrm
comdlg.tcl83680644editdlrm
console.tcl321940644editdlrm
dialog.tcl58130644editdlrm
entry.tcl182430644editdlrm
focus.tcl48570644editdlrm
fontchooser.tcl177770644editdlrm
iconlist.tcl167410644editdlrm
icons.tcl108840644editdlrm
listbox.tcl146950644editdlrm
megawidget.tcl95650644editdlrm
menu.tcl388280644editdlrm
mkpsenc.tcl293520644editdlrm
msgbox.tcl163590644editdlrm
obsolete.tcl55940644editdlrm
optMenu.tcl15860644editdlrm
palette.tcl81740644editdlrm
panedwindow.tcl51760644editdlrm
pkgIndex.tcl1500644editdlrm
safetk.tcl73700644editdlrm
scale.tcl83860644editdlrm
scrlbar.tcl127320644editdlrm
spinbox.tcl159490644editdlrm
tclIndex202700644editdlrm
tearoff.tcl44680644editdlrm
text.tcl339410644editdlrm
tk.tcl236140644editdlrm
tkAppInit.c46150644editdlrm
tkfbox.tcl383650644editdlrm
unsupported.tcl102520644editdlrm
xmfbox.tcl260020644editdlrm
Edit: /opt/imh/python3.13/lib/tk8.6/text.tcl (33941B)
# text.tcl -- # # This file defines the default bindings for Tk text widgets and provides # procedures that help in implementing the bindings. # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998 by Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # #------------------------------------------------------------------------- # Elements of ::tk::Priv that are used in this file: # # afterId - If non-null, it means that auto-scanning is underway # and it gives the "after" id for the next auto-scan # command to be executed. # char - Character position on the line; kept in order # to allow moving up or down past short lines while # still remembering the desired position. # mouseMoved - Non-zero means the mouse has moved a significant # amount since the button went down (so, for example, # start dragging out a selection). # prevPos - Used when moving up or down lines via the keyboard. # Keeps track of the previous insert position, so # we can distinguish a series of ups and downs, all # in a row, from a new up or down. # selectMode - The style of selection currently underway: # char, word, or line. # x, y - Last known mouse coordinates for scanning # and auto-scanning. # #------------------------------------------------------------------------- #------------------------------------------------------------------------- # The code below creates the default class bindings for text widgets. #------------------------------------------------------------------------- # Standard Motif bindings: bind Text <1> { tk::TextButton1 %W %x %y %W tag remove sel 0.0 end } bind Text { set tk::Priv(x) %x set tk::Priv(y) %y tk::TextSelectTo %W %x %y } bind Text { set tk::Priv(selectMode) word tk::TextSelectTo %W %x %y catch {%W mark set insert sel.first} } bind Text { set tk::Priv(selectMode) line tk::TextSelectTo %W %x %y catch {%W mark set insert sel.first} } bind Text { tk::TextResetAnchor %W @%x,%y set tk::Priv(selectMode) char tk::TextSelectTo %W %x %y } bind Text { set tk::Priv(selectMode) word tk::TextSelectTo %W %x %y 1 } bind Text { set tk::Priv(selectMode) line tk::TextSelectTo %W %x %y } bind Text { set tk::Priv(x) %x set tk::Priv(y) %y tk::TextAutoScan %W } bind Text { tk::CancelRepeat } bind Text { tk::CancelRepeat } bind Text { %W mark set insert @%x,%y # An operation that moves the insert mark without making it # one end of the selection must insert an autoseparator if {[%W cget -autoseparators]} { %W edit separator } } # stop an accidental double click triggering bind Text { # nothing } # stop an accidental movement triggering bind Text { # nothing } bind Text <> { tk::TextSetCursor %W insert-1displayindices } bind Text <> { tk::TextSetCursor %W insert+1displayindices } bind Text <> { tk::TextSetCursor %W [tk::TextUpDownLine %W -1] } bind Text <> { tk::TextSetCursor %W [tk::TextUpDownLine %W 1] } bind Text <> { tk::TextKeySelect %W [%W index {insert - 1displayindices}] } bind Text <> { tk::TextKeySelect %W [%W index {insert + 1displayindices}] } bind Text <> { tk::TextKeySelect %W [tk::TextUpDownLine %W -1] } bind Text <> { tk::TextKeySelect %W [tk::TextUpDownLine %W 1] } bind Text <> { tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } bind Text <> { tk::TextSetCursor %W [tk::TextNextWord %W insert] } bind Text <> { tk::TextSetCursor %W [tk::TextPrevPara %W insert] } bind Text <> { tk::TextSetCursor %W [tk::TextNextPara %W insert] } bind Text <> { tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } bind Text <> { tk::TextKeySelect %W [tk::TextNextWord %W insert] } bind Text <> { tk::TextKeySelect %W [tk::TextPrevPara %W insert] } bind Text <> { tk::TextKeySelect %W [tk::TextNextPara %W insert] } bind Text { tk::TextSetCursor %W [tk::TextScrollPages %W -1] } bind Text { tk::TextKeySelect %W [tk::TextScrollPages %W -1] } bind Text { tk::TextSetCursor %W [tk::TextScrollPages %W 1] } bind Text { tk::TextKeySelect %W [tk::TextScrollPages %W 1] } bind Text { %W xview scroll -1 page } bind Text { %W xview scroll 1 page } bind Text <> { tk::TextSetCursor %W {insert display linestart} } bind Text <> { tk::TextKeySelect %W {insert display linestart} } bind Text <> { tk::TextSetCursor %W {insert display lineend} } bind Text <> { tk::TextKeySelect %W {insert display lineend} } bind Text { tk::TextSetCursor %W 1.0 } bind Text { tk::TextKeySelect %W 1.0 } bind Text { tk::TextSetCursor %W {end - 1 indices} } bind Text { tk::TextKeySelect %W {end - 1 indices} } bind Text { if {[%W cget -state] eq "normal"} { tk::TextInsert %W \t focus %W break } } bind Text { # Needed only to keep binding from triggering; doesn't # have to actually do anything. break } bind Text { focus [tk_focusNext %W] } bind Text { focus [tk_focusPrev %W] } bind Text { tk::TextInsert %W \t } bind Text { tk::TextInsert %W \n if {[%W cget -autoseparators]} { %W edit separator } } bind Text { if {[tk::TextCursorInSelection %W]} { %W delete sel.first sel.last } else { if {[%W compare end != insert+1c]} { %W delete insert } %W see insert } } bind Text { if {[tk::TextCursorInSelection %W]} { %W delete sel.first sel.last } else { if {[%W compare insert != 1.0]} { %W delete insert-1c } %W see insert } } bind Text { %W mark set [tk::TextAnchor %W] insert } bind Text