If you look at the docs for handle-gesture, it says "Outputs f if the
gesture was handled, and t if the gesture should be passed on to the
gadget's parent.".

    http://docs.factorcode.org/content/word-handle-gesture,ui.gestures.html

I would guess it's because your editor is wrapped by a main-gadget and any
actions that are ui.commands are "handled" by the editor and not passed to
the parent gadget.


https://github.com/slavapestov/factor/blob/master/basis/ui/gadgets/editors/editors.factor#L425

So, "left" is handled (meaning ``f`` don't pass to parent):

    IN: scratchpad T{ key-down f f "LEFT" } <editor> get-gesture-handler .
    [ \ previous-character invoke-command ]

    IN: scratchpad T{ key-down f f "LEFT" } <editor> handle-gesture .
    f

But, "up" is not (because it isn't a multiline-editor):

    IN: scratchpad T{ key-down f f "UP" } <editor> get-gesture-handler .
    f

    IN: scratchpad T{ key-down f f "UP" } <editor> handle-gesture .
    t

If you want an editor that always passes gestures, then...

    TUPLE: my-editor < editor ;

    : <my-editor> ( -- editor )
        my-editor new-editor ;

    M: my-editor handle-gesture call-next-method drop t ;

Hope that helps!




On Mon, Aug 17, 2015 at 10:55 PM, Georg Simon <georg.si...@auge.de> wrote:

> Ubuntu 14.04.2 LTS
> Factor 0.98 x86.64 (1565, heads/master-0-g592764d, Wed Dec 24 04:52:05
> 2014) [GCC 4.8.2] on linux
>
> In the test program http://paste.factorcode.org/paste?id=3590
> BACKSPACE and DELETE
> don't appear in the terminal as they are handled by editor.
> UP and DOWN
> appear in the terminal as they are not handled by editor.
> But C+c and C+v
> appear in the terminal although they are handled by editor.
>
> In my application I can catch them separately when I know they are
> handled by editor. But is there a better way?
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to