slang-users mailing list

[1999 Date Index] [1999 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: mouse event in SLang_read_line


Sorry for delayed response.

On Thu, Aug 19, 1999 at 03:52:48AM -0400,
"John E. Davis" <davis@xxxxxxxxxxxxx> wrote:

> kikutani@xxxxxxxxxxxxxx <kikutani@xxxxxxxxxxxxxx> wrote:
> >But even though a default value is provided at the mini buffer,
> >I should press ENTER. I'd be happy if SLang_read_line can recognize
> >a mouse click as ENTER key.
> 
> After calling 
> 
>     int SLang_init_readline (SLang_RLine_Info_Type *rli)
>     
> use rli->keymap as the keymap argument to the SLkm_define_key
> function to bind the mouse key, e.g.,
> 
>     static int mouse_cmd (void)
>     {
>        /* Discard mouse info */
>        (void) SLang_getkey ();  
>        (void) SLang_getkey ();  
>        (void) SLang_getkey ();
>        
>        (void) SLang_ungetkey ('\r');
>     }
> 
>         .
> 	.
>     SLang_init_readline (rli);
>     SLkm_define_key ("\033[M", mouse_cmd, rli->keymap);

It worked!
Thank you.

makoto
-- 
Kikutani, Makoto  kikutani@xxxxxxxxxxxxxx


[1999 date index] [1999 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]