gpm icon indicating copy to clipboard operation
gpm copied to clipboard

add support to report a mouse events via stdin with esc-sequences:

Open seyko2 opened this issue 9 years ago • 6 comments

an xterm-like mouse reporting. A bugs reports to [email protected]

getc() { stty raw dd bs=1 count=1 2>/dev/null stty cooked }

handle_mouse() { local c c="getc" [ "$c" = "[" ] || return c="getc" [ "$c" = "M" ] || return b="getc" x="getc" y="getc" b=printf "%u" "'$b" x=printf "%u" "'$x" y=printf "%u" "'$y" b=$(($b - 32)) x=$(($x - 32)) y=$(($y - 32)) echo "$b $x $y" }

stty -echo printf '\033[?1000h' ESC="printf '\033'" while true ; do c="getc" if [ "$c" = "$ESC" ] ; then handle_mouse fi if [ "$c" = "q" ] ; then break fi done printf '\033[?1000l' stty echo

echo

seyko2 avatar Sep 25 '14 02:09 seyko2

Maybe a nice idea, but what about the documentation?

telmich avatar Nov 17 '14 11:11 telmich

What documentation is needed? Patch for gpm is developed to allow use a mouse control in a turbo vision programs with pseudo terminal as stdin/stdout. This feature can be tested with tmux or mc too. gpm sends some mouse events using a TIOCLLINUX syscall to a program in the current console which enabled a xterm-like mouse reporting (via esc-sequence \033[?1000h)

linux kernel has a TIOCL_SELMOUSEREPORT (TIOCLINUX) support since a version 2.2. But even current version of gpm don't support this. https://googledrive.com/host/0B35PjbLHNzyqNS13R0M1aEctND is an archive (with a real name gpm-xterm.tar.xz) on my google drive with a patch for a current version of gpm to support a mouse position reporting. Archive contain a patch, a test script, a binary of modified gpm and a test program atvedit (an editor from a turbo vision). Start it from a Midnigth commander (or a telnet session) to test a mouse reporting. atvedit don't start from a bash prompt if gpm is running.

2014-11-17 15:09 GMT+04:00, Nico Schottelius [email protected]:

Maybe a nice idea, but what about the documentation?


Reply to this email directly or view it on GitHub: https://github.com/telmich/gpm/pull/4#issuecomment-63289853

seyko2 avatar Nov 18 '14 03:11 seyko2

What the resolution about this pull request?

seyko2 avatar Oct 11 '15 11:10 seyko2

How is anyone going to use this without being mentioned in the docs?

telmich avatar Feb 14 '16 19:02 telmich

How is anyone going to use this without being mentioned in the docs?

"gpm supports now x-term like mouse reporting events on Linux console" in changelog and somewhere in the docs?

seyko2 avatar Mar 28 '16 10:03 seyko2

Please see #29 for a broader picture!

egmontkob avatar Sep 21 '18 18:09 egmontkob