9front - general discussion about 9front
 help / color / mirror / Atom feed
From: qwx <qu7uux@gmail.com>
To: 9front@9front.org
Subject: doom: re-center mouse more often to limit it escaping
Date: Thu, 30 Jun 2016 20:07:44 +0200	[thread overview]
Message-ID: <20160630180744.GD28996@u14> (raw)

doom: re-center mouse more often to limit it escaping

when a mouse motion reaches grabout's limits without crossing them, a following
event in which the mouse passes the remaining distance between grabout and the
window's limits will have the mouse jump out of the window.
this happens too frequently on terminals with a good drawing speed.

to reduce this, make grabout smaller, so that the distance to cross in one
event is larger. Dx(screen->r)/4 is sufficient for the terminals i have tested
this on.

diff -r 0a3cf47fce65 sys/src/games/doom/i_video.c
--- a/sys/src/games/doom/i_video.c	Mon Jun 27 00:36:54 2016 +0200
+++ b/sys/src/games/doom/i_video.c	Thu Jun 30 17:51:32 2016 +0300
@@ -44,7 +44,7 @@
 	draw(screen, screen->r, display->black, nil, ZP);
 
 	center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2));
-	grabout = insetrect(screen->r, Dx(screen->r)/8);
+	grabout = insetrect(screen->r, Dx(screen->r)/4);
 
 	if((pid = rfork(RFPROC|RFMEM)) == 0){
 		kbdproc();
@@ -102,7 +102,7 @@
 		draw(screen, screen->r, display->black, nil, ZP);
 
 		center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2));
-		grabout = insetrect(screen->r, Dx(screen->r)/8);
+		grabout = insetrect(screen->r, Dx(screen->r)/4);
 	}
 
 	scale = Dx(screen->r)/SCREENWIDTH;


                 reply	other threads:[~2016-06-30 15:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160630180744.GD28996@u14 \
    --to=qu7uux@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).