Thank you.

What you describe is what I use. And I do not want an editor that
always passes gestures.
But now it comes to C+c, C+v, C+x, C+y, and C+z.
There is no gesture-handler in editor for them:

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

But they work. They work as expected as copy, paste, cut, redo, and
undo.
And they are documented in
http://docs.factorcode.org/content/article-gadgets-editors-commands.html

How can I detect in my program that C+c works but for instance C+d not?

Am Tue, 18 Aug 2015 07:37:24 -0700
schrieb John Benediktsson <mrj...@gmail.com>:

> 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