slang-users mailing list

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

Re: [slang-users] Using Mouse in S-Lang ....


Ben Duncan <ben@xxxxxxxxxxxxxxxxxx> wrote:
>Ok, where can I go to RTFM or RTFSC on using the mouse under S-Lang.
>My needs are simple, All I need/want is what row/column did they right click
>on and if they "scolled", was it up or down.

If the terminal supports xterm mouse reporting, the use can enable it
via:
 
   SLtt_set_mouse_mode (1, 0);

The you need to be prepared to handle the resulting reports, which
will come in encoded as key sequences.  slrn does this via:

   SLkm_define_key  ("\033[M\040", (FVOID_STAR) art_mouse_left, Slrn_Article_Keymap);
   SLkm_define_key  ("\033[M\041", (FVOID_STAR) art_mouse_middle, Slrn_Article_Keymap);
   SLkm_define_key  ("\033[M\042", (FVOID_STAR) art_mouse_right, Slrn_Article_Keymap);

where, e.g., art_mouse_left is something like:

  void art_mouse_left (void)
  {
     int row, col;
     col = (unsigned char) SLang_getkey () - 32;
     row = (unsigned char) SLang_getkey () - 32;
	 .
	 .
  }


--John

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


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