On Wed, Aug 28, 2002 at 08:38:39AM +0200, Lars Gullik Bjønnes wrote:
> Not too bad. But I feel that the switch/cases are a bit too big and
> really should be kept in separate functions.

I said I'll move them down to LyXText (which will make them slimmer).
If they are still big than, I'll put them into seperate functions.
Certainly today...

> Also, one thing I'd really like to see (not necessarily in this
> patch), is to split the mouse lfuns ... not that is not what I want...
> 
> I want it to be possible to do a
> 
> \bind mouse-button-1 place-cursor
> 
> kindo of binding. This means that the mouse buttons must be seen as a
> kind of keyboard-key. (keysym if you want)

Sort of LFUN re-mapping. Should be possible. Actually I like the idea
because it makes things more flexible...

> This also implies that there should not be _any_ kind of special LFUNS
> for mouse handling, but that you use key-bindings to achieve that
> instead. Then we should not need any kind of special casing in the
> code on "which button was pressed" or any explicit mouse button
> handling at all.

I'd approach this a bit differently. Assume for a while we have
inset-local bindings and that lfun re-map feature.

The workarea could still generate mouse FuncRequest. After all, the
workarea is completely ignorant of text, formulas etc. It only knows it got
clicked and has to do something with it. So it passes the mouse lfun to
BufferView::dispatch(), and as BufferView is ignorant of this, too, it gets
passed in the default branch to LyXText::dispatch(). 

Now LyXText is the first thing that knows something about text. If the
click hits part of the text, the lfun gets LyXText-locally remapped to 
some "set cursor" lfun. If the click hits an inset, the FuncRequest is
passed on to inset::localDispatch without a change. Now the inset can react
to the click by e.g. opening a dialog.

If we did a global re-map of "mouse-press" to "cursor-set", the inset would
have to react to "cursor-set", which is wrong. After all the inset (say
InsetRef) does not have to have a cursor at all, and the inset really wants
to react to a mouse click and to nothing else. The user might have chosen
e.g. to re-map "mouse-press" to "explain-that-thing" so suddenly he can't
open InsetRefs anymore. Would completely spoil that idea of lfun remapping.. 

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to