• ISO the 'up and 'down' bindings for the text widget

    From Helmut Giese@21:1/5 to All on Fri Apr 15 21:21:11 2022
    Hello out there,
    consider the following piece of code:
    ---
    package require Tk
    pack [text .t]
    .t insert 1.0 "line 1\nline 2\nline 3\n"
    bind .t # the result is nothing as expected
    bind Text # the result on my machine (Windows 64 bit, Tcl
    8.6.10) is: Shift-MouseWheel> <MouseWheel> <B2-Motion> <Button-2> <Control-Key-h> <<TkAccentBackspace>> <<TkClearIMEMarkedText>> <<TkEndIMEMarkedText>> <<TkStartIMEMarkedText>> <Meta-Key-Delete> <Meta-Key-BackSpace> <Meta-Key-greater> <Meta-Key-less> <Meta-Key-f> <Meta-Key-d> <Meta-Key-b> <<Redo>> <<Undo>> <Control-Key-t>
    <Control-Key-o> <Control-Key-k> <Control-Key-d> <Key-KP_Enter>
    <Key-Escape> <Control-Key> <Meta-Key> <Alt-Key> <Key> <Key-Insert> <<PasteSelection>> <<Clear>> <<Paste>> <<Copy>> <<Cut>> <<SelectNone>> <<SelectAll>> <Shift-Key-Select> <Control-Shift-Key-space>
    <Key-Select> <Control-Key-space> <Key-BackSpace> <Key-Delete>
    <Key-Return> <Control-Key-i> <Control-Shift-Key-Tab> <Control-Key-Tab> <Shift-Key-Tab> <Key-Tab> <Control-Shift-Key-End> <Control-Key-End> <Control-Shift-Key-Home> <Control-Key-Home> <<SelectLineEnd>>
    <<LineEnd>> <<SelectLineStart>> <<LineStart>> <Control-Key-Next> <Control-Key-Prior> <Shift-Key-Next> <Key-Next> <Shift-Key-Prior>
    <Key-Prior> <<SelectNextPara>> <<SelectPrevPara>> <<SelectNextWord>> <<SelectPrevWord>> <<NextPara>> <<PrevPara>> <<NextWord>> <<PrevWord>> <<SelectNextLine>> <<SelectPrevLine>> <<SelectNextChar>>
    <<SelectPrevChar>> <<NextLine>> <<PrevLine>> <<NextChar>> <<PrevChar>> <Control-B1-Motion> <Double-Control-Button-1> <Control-Button-1> <ButtonRelease-1> <B1-Enter> <B1-Leave> <Triple-Shift-Button-1> <Double-Shift-Button-1> <Shift-Button-1> <Triple-Button-1>
    <Double-Button-1> <B1-Motion> <Button-1>

    No binding for 'up' or 'down' in sight (nor for 'ctrl p' or 'ctrl n'
    which - according to the manual - are synonyms) - but if you click
    into the widget the keys work as expected.

    Any help with solving this mystery will be greatly appreciated.
    Helmut

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Leitgeb@21:1/5 to Helmut Giese on Fri Apr 15 19:31:45 2022
    Helmut Giese <[email protected]> wrote:
    consider the following piece of code:
    ---
    package require Tk
    pack [text .t]
    .t insert 1.0 "line 1\nline 2\nline 3\n"
    bind .t # the result is nothing as expected
    bind Text # the result on my machine (Windows 64 bit, Tcl
    8.6.10) is:
    [...]
    No binding for 'up' or 'down' in sight (nor for 'ctrl p' or 'ctrl n'

    It's those two: <<NextLine>> <<PrevLine>> and

    % event info <<PrevLine>>
    <Key-Up> <Control-Key-p> <Control-Lock-Key-P>

    :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Giese@21:1/5 to All on Fri Apr 15 22:22:06 2022
    Argghhh,
    however I should have noticed it myself: Only yesterday I was looking
    for the bindings for page-up/down and discovered only accidentally
    that they are 'Prior' and 'Next'. But the analogy 'When 'Page Down'
    maps to 'Next' what does 'Down' map to?' was evidently too far for me.
    Anyway, many thanks Andreas and have a nice weekend
    Helmut

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)