On Tue, Jan 14, 2014 at 2:58 PM, Michael Lachmann <lachm...@eva.mpg.de>wrote:
> Wouldn't it be possible to implement a widget based on QTMTreeModel, so > that > text entry to it is a tree, and then (maybe) keys would work like in > TeXmacs, and > one could also enter trees into other dialogs (e.g. search/replace)? > QTMTreeModel is just a proxy for a tree observer and is intended to be used in conjunction with a view like QTMTreeView (which I implemented for a super-secret project of mine yet in my private git repo only). So to be pedantic (sorry), one cannot base a widget on it although one could of course use it as a model. However, this wouldn't help at all with the issue at hand. Currently, QTMWidget (which more or less implements the TeXmacs canvas) catches QKeyEvents and rewrites and queues them in our own event queue as QP_KEYPRESS. After a while they are sent to the TeXmacs editor itself in edit_interface_rep::handle_keypress (), where scheme code is called and kbd-maps are taken into account. Therefore what we need is writing QTMLineWidget::keyPressEvent() to catch keypresses and then respond to them either * using hardcoded keymaps * or reading the keymaps from scheme, possibly using kbd-find-rev-binding. I'd obviously go for the second one. Best, -- Miguel de Benito.
_______________________________________________ Texmacs-dev mailing list Texmacs-dev@gnu.org https://lists.gnu.org/mailman/listinfo/texmacs-dev