delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/19/15:15:09

Message-ID: <33A98582.21D8@seanet.com>
Date: Thu, 19 Jun 1997 12:16:18 -0700
From: "Alan M. Doerhoefer" <aland AT seanet DOT com>
MIME-Version: 1.0
To: djgpp AT delorie DOT com
CC: Shawn AT talula DOT demon DOT co DOT uk
Subject: Re: ALLEGRO: Problems with keyboard shortcut to edit box
References: <866633614 DOT 1311419 DOT 0 AT acecoin DOT demon DOT co DOT uk> <fQjEQPAQMFqzEw3N AT talula DOT demon DOT co DOT uk>

Here is a change to Allegro's move_focus routine that worked for me to
change the behaviour of the tab key.  I just moved the KEY_TAB entry in
the switch statement so that it falls through to the KEY_DOWN case. The
shift-tab key could be added to the case statement so that it falls
through to the KEY_UP case. 

static int move_focus(DIALOG *d, long ch, int *focus_obj)
{
   int (*cmp)(DIALOG *d1, DIALOG *d2);
   OBJ_LIST obj[MAX_OBJECTS];
   int obj_count = 0;
   int fobj, c;
   int res = D_O_K;

   /* choose a comparison function */ 
   switch (ch >> 8) {
      case KEY_RIGHT:   cmp = cmp_right;  break;
      case KEY_LEFT:    cmp = cmp_left;   break;
      case KEY_TAB:     /* MY CHANGE: same as down arrow */
      case KEY_DOWN:    cmp = cmp_down;   break;
      case KEY_UP:      cmp = cmp_up;     break;
      default:          return D_O_K;
   }

-- 
Alan Doerhoefer: aland AT seanet DOT com
http://www.seanet.com/~aland

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019