Subject: kern/19925: wscons scrolling
To: None <gnats-bugs@gnats.netbsd.org>
From: David Ferlier <david@netbsd-fr.org>
List: netbsd-bugs
Date: 01/19/2003 07:18:40
>Number:         19925
>Category:       kern
>Synopsis:       wscons scrolling
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 18 22:20:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Ferlier
>Release:        NetBSD 1.6K
>Organization:
>Environment:
NetBSD cobaye 1.6K NetBSD 1.6K (COBAYE) #16: Sun Jan 19 05:20:58 CET 2003     root@cobaye:/usr/src/sys/arch/i386/compile/COBAYE i386
Architecture: i386
Machine: i386
>Description:
I have sent two previous prs (kern/17243 an kern/17445) about this subject.

I reworked the whole framework, corrected some problems, cleaned the code,
added options to files.wscons, and tested it.

To resume, this patch modifies the following files :

sys/dev/wscons/wsdisplay.c
sys/dev/wscons/wskbd.c
sys/dev/wscons/wsdisplayvar.h
sys/dev/wscons/wsksymdef.h
sys/dev/wscons/wsconsio.h
sys/dev/wscons/files.wscons
sys/dev/ic/pcdisplayvar.h
sys/dev/ic/pcdisplay_subr.c
sys/dev/ic/vga.c
sbin/wsconsctl/display.c
sbin/wsconsctl/keyboard.c

This code, if options WSDISPLAY_SCROLLSUPPORT is
in the kernel configuration file, provides an api for scrolling support
on wscons terminals. For the moment, i just added support for vga consoles,
but it should be easy to add new ones.

Basically, there are 4 new wscons commands :

Cmd_ScrollSlowUp
Cmd_ScrollSlowDown
Cmd_ScrollFastUp
Cmd_ScrollFastDown

There are two speeds for scrolling : fast and slow.

you can add them in your keymap, they will determine which *key* will
activate scrolling. You also need to determine a modifier. This is done
by modyfing the scroll.modifier variable wsconsctl's variable. This is
basically a or of some modifiers values.

There are two modes of scrolling :

- linux behavior (scroll.mode=0): you press modifier + Cmd_Scroll{Slow,Fast}
{Up,Down} and it scrolls
- freebsd behavior (scroll.mode=1): you press Hold Screen, and then
Cmd_Scroll{Slow,Fast}{Up,Down} and it scrolls

The number of lines it scrolls are customisable with these wsconsctl variables:

 - scroll.fastlines
 - scroll.slowlines

which respectively controls the number of lines Cmd_ScrollFast* and 
Cmd_ScrollSlow* scrolls.

Another thing: if you run into singleuser :

 - if options WSDISPLAY_SCROLLCOMBO is not set, the default modifier is 
 SHIFT_L (left shift)
 - otherwise, this options is used. Example
    options WSDISPLAY_SCROLLCOMBO="(MOD_META_L | MOD_CONTROL_L)"

So it leaves each port maintainer the choice for a reasonable default.

I hope it's better now, and i am waiting for input.
You can get the patch at the Fix: url.
Thanks.

>How-To-Repeat:

>Fix:
	http://happy-hacking.homeunix.org/netbsd/patches/kernel/wsscroll.diff
>Release-Note:
>Audit-Trail:
>Unformatted: