Subject: Re: console scrolling
To: None <tech-net@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: tech-net
Date: 01/29/2007 23:05:50
--7ZAtKRhVyVSsbBD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Joerg Sonnenberger wrote:
> On Mon, Jan 29, 2007 at 09:46:22PM +0100, Christian Biere wrote:
> > Joerg Sonnenberger wrote:
> > > *Left*-Shift + Page Up/Down
> > 
> > Is this a bug or a feature?
> 
> A documented misfeature? It is written in wsdisplay(4) that way.

Well, it's obviously an artifact of the way the modifier is handled by
the scroll support code. The attached changes this to just look whether
any shift modifier is set. Of course if you wanted Control+Shift as
modifier, Control *or* Shift would be sufficient with this code. I
could imagine though that this is the preferred hack.

-- 
Christian

--7ZAtKRhVyVSsbBD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wskbd.c.udif"

Index: wskbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wskbd.c,v
retrieving revision 1.99
diff -u -p -r1.99 wskbd.c
--- wskbd.c	4 Jan 2007 18:44:46 -0000	1.99
+++ wskbd.c	29 Jan 2007 21:59:52 -0000
@@ -292,7 +292,7 @@ struct wskbd_scroll_data wskbd_default_s
 #ifdef WSDISPLAY_SCROLLCOMBO
  	WSDISPLAY_SCROLLCOMBO,
 #else
- 	MOD_SHIFT_L,
+ 	MOD_ANYSHIFT,
 #endif
 };
 #endif
@@ -1447,7 +1447,7 @@ internal_command(struct wskbd_softc *sc,
 			if ((sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_HOLD
 			   	&& MOD_ONESET(sc->id, MOD_HOLDSCREEN))
 			|| (sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_NORMAL
-				&& sc->sc_scroll_data.modifier == state)) {
+				&& sc->sc_scroll_data.modifier & state)) {
 					update_modifier(sc->id, *type, 0, MOD_COMMAND);
 					wsdisplay_scroll(sc->sc_base.me_dispdv,
 						(ksym == KS_Cmd_ScrollFastUp) ?
@@ -1466,7 +1466,7 @@ internal_command(struct wskbd_softc *sc,
 			if ((sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_HOLD
 			   	&& MOD_ONESET(sc->id, MOD_HOLDSCREEN))
 			|| (sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_NORMAL
-				&& sc->sc_scroll_data.modifier == state)) {
+				&& sc->sc_scroll_data.modifier & state)) {
 					update_modifier(sc->id, *type, 0, MOD_COMMAND);
 					wsdisplay_scroll(sc->sc_base.me_dispdv,
 					   	(ksym == KS_Cmd_ScrollSlowUp) ?

--7ZAtKRhVyVSsbBD2--