Subject: Re: wscons
To: None <krp@freeshell.org>
From: TAKEMURA Shin <takemura@netbsd.org>
List: current-users
Date: 07/02/2002 10:38:32
From: David Ferlier <krp@freeshell.org>
Subject: Re: wscons
Date: Mon, 1 Jul 2002 14:53:52 +0000

> On Mon, Jul 01, 2002 at 08:04:43PM +0900, TAKEMURA Shin wrote:
> >   You can scroll with Cmd Modifier + scroll keys (the Linux behavior). 
> >   AND you can use the behavior of FreeBSD : You need to press HoldScreen, 
> >   then use scroll keys to scroll up / down.
> 
> I agree on one point : i think we definitely should remove the first 
> option (the mode) : i used my patch for 2 or 3 days, and the two modes
> have advantages so let's activate both.

yes.

> For the scroll.modifier option, don't you think it is a quite good idea ?

I don't say you should throw it away. I just said you can.
At least, it might be good to call scroll ops when Cmd modifier keys and 
scroll key are pressed.

In wskbd.c:

+ #ifdef WSDISPLAY_SCROLLSUPPORT
+ static void
+ scroll_command(struct wskbd_softc *sc, keysym_t ksym)
+ {
+         switch (ksym) {
+         case KS_Cmd_ScrollFastUp:
+         case KS_Cmd_ScrollFastDown:
+                 wsdisplay_scroll(sc->sc_base.me_dispdv,
+                     (ksym == KS_Cmd_ScrollFastUp) ?
+                     WSDISPLAY_SCROLL_BACKWARD :
+                     WSDISPLAY_SCROLL_FORWARD);
+                 break;
+         case KS_Cmd_ScrollSlowUp:
+         case KS_Cmd_ScrollSlowDown:
+                 wsdisplay_scroll(sc->sc_base.me_dispdv,
+                     (ksym == KS_Cmd_ScrollSlowUp) ?
+                     WSDISPLAY_SCROLL_BACKWARD | WSDISPLAY_SCROLL_LOW:
+                     WSDISPLAY_SCROLL_FORWARD | WSDISPLAY_SCROLL_LOW);
+                 break;
+         }
+ }
+ #endif

  static int
  internal_command(struct wskbd_softc *sc, u_int *type, keysym_t ksym,
          keysym_t ksym2)
  {

+ #ifdef WSDISPLAY_SCROLLSUPPORT
+         if (*type == WSCONS_EVENT_KEY_DOWN &&
+             MOD_ONESET(sc->id, MOD_HOLDSCREEN)) {
+                switch (ksym) {
+                case KS_Cmd_ScrollFastUp:
+                case KS_Cmd_ScrollFastDown:
+                case KS_Cmd_ScrollSlowUp:
+                case KS_Cmd_ScrollSlowDown:
+                       scroll_command(sc, ksym);
+                       return (1);
+                default;
+                       /* XXX, what should i do ? */
+                       break;
+                }
+         }
+ #endif

          /*
           * snipped
           */

          if (*type != WSCONS_EVENT_KEY_DOWN ||
              (! MOD_ONESET(sc->id, MOD_COMMAND) &&
               ! MOD_ALLSET(sc->id, MOD_COMMAND1 | MOD_COMMAND2)))
                  return (0);

          switch (ksym) {
+ #ifdef WSDISPLAY_SCROLLSUPPORT
+         case KS_Cmd_ScrollFastUp:
+         case KS_Cmd_ScrollFastDown:
+         case KS_Cmd_ScrollSlowUp:
+         case KS_Cmd_ScrollSlowDown:
+                 scroll_command(sc, ksym);
+                 return (1);
+ #endif

> > ...please feel free to ignore this mail because I remember the war about
> > key bindings and I know that your idea is more flexible than mine.
> > But it's just that I'd like to have simple one.
> 
> If you don't like it, you can still propose a better one cause mine is
> more than perfectible. But if you already have an idea, would it allow
> the user to change the modifier on the fly ? In the kernel ? (my way of
> seeing should provide both)

You can change Cmd modifier key bindings without recompile kernel.

Takemura