Since 8.6b3, bindings do not appear to work the same way as before in applications. See for example this thread on c.l.t about tkcon -
https://groups.google.com/forum/?fromgroups=#!searchin/comp.lang.tcl/tkcon$20bindings/comp.lang.tcl/7ki8-TxMNdk/bn7lr7LTmUwJ
dkf suggested in that thread this might be a result of the new virtual event definitions added for 8.6b3.
Is this a temporary state of affairs that will be fixed for 8.6 final? If not, is there any document that describes the changes applications will have to make, and does this not spoil Tcl/Tk's great backward compatibility.
/Ashok
For the Windows console in Tk, the same happened:
For the fix there see: <http://core.tcl.tk/tk/ci/6249d7ae63?sbs=1>
It only happens with Virtual Key bindings, not so many
applications use that. For tkCon, is the only application
I know of that has this problem, the cause is that tkCon
choose its own name for its own virtual events. Letting
the name match the - now generic - virtual events
will fix the problem.
My proposed solution attached (tkcon.diff)
Ok, fair enough thanks. Unfortunately, for me tkcon is not an app but an embeddable package as well. Only a couple of programs though, so I'll just use your patch for new versions.
While I could add the PrevLine/NextLine changes (and that will work for pre-8.6 as well), I'm concerned that this is an interesting aspect of compat violation. I have other software out there (the console as a megawidget) that is very widespread in various user's code. The same goes with tkcon as an embedded console - very popular, and this change breaks all those installs.
Was this really a necessary change? Where is the reference core change?
The lesson leared here is that virtual events should
not be defined by extensions/applications, but only
by Tk.
Let's look at the virtual events defined by console.tcl. They
can be divided into 3 groups:
- <<Console_Expand>>, <<Console_Tab>>, <<Console_Eval>>
Multiple keys which have the same binding
- <<Console_FontSizeIncr>>, <<Console_FontSizeDecr>>, <<Console_Transpose>>
Bindings are different for X11/Mac/Windows
- All other virtual events in console.tcl serve no purpose, as far as I can see. All bindings could just as well be done against the real events directly. Done so (as experiment) in the "bug-3582795" branch. Jeff, is there any added value in using virtual events here?
Removing those unnecessary virtual events, 6 are left which seen useful.
Would it help if Tk defined virtual events for those 6? Then console.tcl
does not need to define its own virtual events any more, so any
risk in future compatibility is gone. The pain is felt only once.
(For TkCon, the virtual events have the form <<TkCon_*>>,
but apart from that it looks very similar to console.tcl)
See:
<http://core.tcl.tk/tk/ci/4712ce4f04>
suggested fix
Better fix for tkcon, which handles <Control-Key-n> and <Control-Key-p> as well.