Undiscussed Horrific Abuse, One Victim of Many gmkarl at gmail.com
Sun May 15 10:00:21 PDT 2022

#include <termios.h>
#include <stdio.h>

int main()
  // one way to enable mouse tracking

  // disable echo and line buffering for mouse
  struct termios term;
  tcgetattr(0, &term);
  term.c_lflag &= ~(ECHO | ICANON);
  tcsetattr(0, TCSANOW, &term);

  // read next mouse location
  int x,y;
  scanf("\e[<0;%d;%dM", &x, &y);

  // disable mouse tracking, maybe misordered

  // output mouse location
  printf("%d %d\n", x, y);

  // enable echo and line buffering
  term.c_lflag |= ECHO | ICANON;
  tcsetattr(0, TCSANOW, &term);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/html
Size: 1321 bytes
Desc: not available
URL: <https://lists.cpunks.org/pipermail/cypherpunks/attachments/20220515/51cd8f2d/attachment.txt>

More information about the cypherpunks mailing list