TIP: Click on subject to list as thread! ANSI
echo: wanna_point
to: Matthew Palmer
from: Paul Edwards
date: 1996-11-24 03:01:28
subject: problems

MP> 3) Msged does not accept  combinations, arrow keys, and most other 
MP>   key combinations.
MP>    No known fix, although it may be a termcap problem.

PE> Yes, I documented that you would need to redefine all the keys to ctrl 
PE> keys.  I don't know why the Alt keys don't come through.  If you type in 
PE> "msged -k", then any key you can get a keycode for, can be used.

PE> I did this today, and I think I can make the Alt-keys work under linux.  
PE> I'll get back to you.  BFN.  Paul.

Done it!  You can now use the Alt keys and cursor keys.  You need to apply
this patch to your sources...

Index: ansi.c
===================================================================
RCS file: g:\cvs\msged\src\ansi.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -c -r1.30 -r1.31
*** ansi.c	1996/07/24 16:01:21	1.30
--- ansi.c	1996/11/23 16:50:28	1.31
***************
*** 23,28 ****
--- 23,32 ----
  #include "winsys.h"
  #include "unused.h"
  
+ #ifdef UNIX
+ #include "keys.h"
+ #endif
+ 
  int vcol, vrow;                 /* cursor position         */
  int color;                      /* current color on screen */
  int cur_start = 0;
***************
*** 256,261 ****
--- 260,381 ----
          if (ch <= 0)
          {
              ch = -1;
+         }
+         else if (ch == 0x1b)
+         {
+             ch = getchar();
+             if (ch <= 0)
+             {
+                 ch = 0x1b;
+             }
+             else
+             {
+                 switch (ch)
+                 {
+                     case 'a':
+                         ch = Key_A_A;
+                         break;
+                     case 'b':
+                         ch = Key_A_B;
+                         break;
+                     case 'c':
+                         ch = Key_A_C;
+                         break;
+                     case 'd':
+                         ch = Key_A_D;
+                         break;
+                     case 'e':
+                         ch = Key_A_E;
+                         break;
+                     case 'f':
+                         ch = Key_A_F;
+                         break;
+                     case 'g':
+                         ch = Key_A_G;
+                         break;
+                     case 'h':
+                         ch = Key_A_H;
+                         break;
+                     case 'i':
+                         ch = Key_A_I;
+                         break;
+                     case 'j':
+                         ch = Key_A_J;
+                         break;
+                     case 'k':
+                         ch = Key_A_K;
+                         break;
+                     case 'l':
+                         ch = Key_A_L;
+                         break;
+                     case 'm':
+                         ch = Key_A_M;
+                         break;
+                     case 'n':
+                         ch = Key_A_N;
+                         break;
+                     case 'o':
+                         ch = Key_A_O;
+                         break;
+                     case 'p':
+                         ch = Key_A_P;
+                         break;
+                     case 'q':
+                         ch = Key_A_Q;
+                         break;
+                     case 'r':
+                         ch = Key_A_R;
+                         break;
+                     case 's':
+                         ch = Key_A_S;
+                         break;
+                     case 't':
+                         ch = Key_A_T;
+                         break;
+                     case 'u':
+                         ch = Key_A_U;
+                         break;
+                     case 'v':
+                         ch = Key_A_V;
+                         break;
+                     case 'w':
+                         ch = Key_A_W;
+                         break;
+                     case 'x':
+                         ch = Key_A_X;
+                         break;
+                     case 'y':
+                         ch = Key_A_Y;
+                         break;
+                     case 'z':
+                         ch = Key_A_Z;
+                         break;
+                     case '[':
+                         ch = getchar();
+                         switch (ch)
+                         {
+                             case 'A':
+                                 ch = Key_Up;
+                                 break;
+                             case 'B':
+                                 ch = Key_Dwn;
+                                 break;
+                             case 'C':
+                                 ch = Key_Rgt;
+                                 break;
+                             case 'D':
+                                 ch = Key_Lft;
+                                 break;
+                             default:
+                                 ch = 0x1b;
+                                 break;
+                         }
+                         break;
+                     default:
+                         ch = 0x1b;
+                         break;
+                 }
+             }
          }
      }
  #else
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.