wok-current rev 19009

busybox/fbvnc: wheelmouse support (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 28 18:28:53 2016 +0200 (2016-03-28)
parents dbf4eeed945f
children 364e68c766fd
files busybox/stuff/busybox-1.23-fbvnc.u
line diff
     1.1 --- a/busybox/stuff/busybox-1.23-fbvnc.u	Mon Mar 28 18:04:41 2016 +0200
     1.2 +++ b/busybox/stuff/busybox-1.23-fbvnc.u	Mon Mar 28 18:28:53 2016 +0200
     1.3 @@ -304,10 +304,10 @@
     1.4  +
     1.5  +static void cleanup(void)
     1.6  +{
     1.7 -+	const char *reset = "\x1b[?25h" "\x1b[2J\x1b[H";
     1.8 ++#define RESETSTR "\x1b[?25h\x1b[2J\x1b[H"
     1.9  +	fb_free();
    1.10  +	tcsetattr_stdin_TCSANOW(&G.term_orig);
    1.11 -+	write(STDOUT_FILENO, reset, strlen(reset));
    1.12 ++	write(STDOUT_FILENO, RESETSTR, sizeof(RESETSTR));
    1.13  +	if (ENABLE_FEATURE_CLEAN_UP) {
    1.14  +		close(G.vnc_fd);
    1.15  +		close(G.rat_fd);
    1.16 @@ -515,9 +515,9 @@
    1.17  +static void term_setup(void)
    1.18  +{
    1.19  +	struct termios termios;
    1.20 -+	const char *init = "\x1b[?25l" "\x1b[2J\x1b[H" "** fbvnc **";
    1.21 ++#define INITSTR	"\x1b[?25l\x1b[2J\x1b[H** fbvnc **"
    1.22  +
    1.23 -+	write(STDOUT_FILENO, init, strlen(init));
    1.24 ++	write(STDOUT_FILENO, INITSTR, sizeof(INITSTR));
    1.25  +	tcgetattr (STDIN_FILENO, &termios);
    1.26  +	G.term_orig = termios;
    1.27  +	cfmakeraw(&termios);
    1.28 @@ -537,8 +537,8 @@
    1.29  +	G.vnc_fd = create_and_connect_stream_or_die(host, port);
    1.30  +	vnc_init();
    1.31  +	G.rat_fd = open("/dev/input/mice", O_RDWR);
    1.32 -+	write(rat_fd, "\xf3\xc8\xf3\x64\xf3\x50", 6);	/* for using mouse wheel */
    1.33 -+	read(rat_fd, buf, 1);
    1.34 ++	write(G.rat_fd, "\xf3\xc8\xf3\x64\xf3\x50", 6);	/* for using mouse wheel */
    1.35 ++	read(G.rat_fd, buf, 1);
    1.36  +	term_setup();
    1.37  +	atexit(cleanup);
    1.38  +	bb_signals(BB_FATAL_SIGS, killed);