getting Delete key to DELETE on RS6000

getting Delete key to DELETE on RS6000

Post by Milt Epste » Sun, 25 Aug 1991 06:17:12



On the RS6000's I use, I'm trying to figure out how to get the Delete
key to be DELETE (I have erase set to ^? and I use emacs -- so I don't
want to use Ctrl-H for destructive backspace).  Currently, Backspace
and Shift-Backspace generate Ctrl-H, Ctrl-Backspace generates DELETE,
and Delete generates Ctrl-[ [ P (same as Esc [ P).

Looking through the documentation, it looks like I may be able to use
chkeymap, but I couldn't figure out how to use it (I couldn't find the
section of the manual which gave the keyboard position codes).  My
understanding is that each key on the keyboard has a keyboard position
code, so if I know the keyboard position code for the Delete key, I
could get the behavior I desire with a command like:

     chkeymap -tc -sb -kNNN -d127

(where NNN is the keyboard position code for the Delete key; 127 is
the ASCII code for DELETE).  Or perhaps I am misunderstadning how this
command works.

I would like this change to stay in effect when I use X also.

For when I use X, I tried to use xmodmap to change this behavior.  I
gave it the following command

     keysym BackSpace = BackSpace Delete

in the hopes that I could get Shift-Backspace to be DELETE, but all
that did was make Shift-Backspace generate Ctrl-[ [ P.

If anyone can tell me how to do this or explain how this key mapping
stuff works, I would appreciate it.

Thanks.

--
Milt Epstein
Department of Computer Science
University of Illinois

 
 
 

getting Delete key to DELETE on RS6000

Post by Chin Fa » Sun, 25 Aug 1991 07:46:20


In article <28B57B58.4...@ibma0.cs.uiuc.edu>, epst...@sunc4.cs.uiuc.edu (Milt Epstein) writes:

[woe about DELETE, Backspace keys in emacs deleted]

Well, what you need may be a nice patch posted here quite a while ago
for emacs 18.57 src/x11term.c.  I don't have the patch on line,
neither the entire src tree (too huge!), so I am going to post
the entire x11term.c here.  You simply replace the original x11term.c
by the one attached below, and then issue make :-)

The place where Mark Andreessen's patch applied is identified with
his last name.  I thank him for this nice fix.  Write him your
thank you notes.

Sincerely,

Chin Fang
Mechanical Engineering Department
Stanford University
fangc...@leland.stanford.edu

-------------------- patched emacs 18.57 x11term.c ------------------
/* X Communication module for terminals which understand the X protocol.
   Copyright (C) 1988, 1990 Free Software Foundation, Inc.

This file is part of GNU Emacs.

GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */

/* Written by Yakim Martillo, mods and things by Robert Krawitz  */
/* Redone for X11 by Robert French */
/* Thanks to Mark Biggers for all of the Window Manager support */

/*
 *      $Source: /mit/emacs/src/RCS/11xterm.c,v $
 *      $Author: rfrench $
 *      $Locker:  $
 *      $Header: x11term.c,v 1.12 88/02/29 14:11:07 rfrench Exp $
 */

#ifndef lint
static char *rcsid_xterm_c = "$Header: x11term.c,v 1.12 88/02/29 14:11:07 rfrench Exp $";
#endif  lint

/* On 4.3 this loses if it comes after x11term.h.
   On hp-ux it loses if it comes after config.h.  */
#include <signal.h>
#include <sys/ioctl.h>

/* Load sys/types.h if not already loaded.
   In some systems loading it twice is suicidal.  */
#ifndef makedev
#include <sys/types.h>
#endif

#include "config.h"

#ifdef HAVE_X_WINDOWS

/* Get FIONREAD, if it is available.
   It would be logical to include <sys/ioctl.h> here,
   but it was moved up above to avoid problems.  */
#ifdef USG
#include <termio.h>
#include <fcntl.h>
#endif /* USG */

#include "lisp.h"
#undef NULL

/* Allow m- file to inhibit use of interrupt-driven input.  */
#ifdef BROKEN_FIONREAD
#undef FIONREAD
#endif

/* We are unable to use interrupts if FIONREAD is not available,
   so flush SIGIO so we won't try.  */
#ifndef FIONREAD
#ifdef SIGIO
#undef SIGIO
#endif
#endif

/* This may include sys/types.h, and that somehow loses
   if this is not done before the other system files.
   However, perhaps the problem has been avoided by loading types.h above.  */

#include "x11term.h"

#ifdef IRIS
#include <sys/sysmacros.h>        /* for "minor" */
#include <sys/time.h>
#else
#ifdef UNIPLUS
#include <sys/time.h>

#else /* not IRIS, not UNIPLUS */
/* Use socket.h just to control whether to use time.h or sys/time.h.
   This works like the code in process.c.  */
#ifdef HAVE_SOCKETS
#include <sys/socket.h>
#endif
#ifdef HAVE_TIMEVAL
/* _h_BSDTYPES is checked because on ISC unix, socket.h includes
   both time.h and sys/time.h, and the latter file is protected
   from repeated inclusion.  */
#if defined(USG) && !defined(_h_BSDTYPES)
#include <time.h>
#else /* _h_BSDTYPES or not USG */
#include <sys/time.h>
#endif /* _h_BSDTYPES or not USG */
#endif /* HAVE_TIMEVAL */
#endif /* not UNIPLUS */
#endif /* not IRIS */

#ifdef BAT68K
#include <sys/time.h>   /* In addition to time.h.  */
#endif

#ifdef AIX
#include <sys/time.h>   /* In addition to time.h.  */

static KeySym XMOD_Alt[] = { XK_Alt_L };
static KeySym XMOD_Shift[] = { XK_Shift_L };
static KeySym XMOD_ShiftAlt[] = { XK_Alt_L, XK_Shift_L };
static KeySym XMOD_CtrlAlt[] = { XK_Control_L, XK_Alt_L };
static KeySym XMOD_Ctrl[] = { XK_Control_L };
static KeySym XMOD_CtrlShift[] = { XK_Control_L, XK_Shift_L };
static KeySym XMOD_ShiftCtrlAlt[] = { XK_Control_L, XK_Alt_L, XK_Shift_L };
#endif

#include <fcntl.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#ifdef BSD
#include <strings.h>
#endif
#include <sys/stat.h>

#include "dispextern.h"
#include "termhooks.h"
#include "termopts.h"
#include "termchar.h"

#include "sink11.h"
#include "sink11mask.h"

#define min(a,b) ((a)<(b) ? (a) : (b))
#define max(a,b) ((a)>(b) ? (a) : (b))

extern int errno;

#define sigunblockx(sig) sigblock (0)
#define sigblockx(sig) sigblock (1 << ((sig) - 1))

#define METABIT 0200
#define MINWIDTH 12     /* In pixels */
#define MINHEIGHT 5     /* In pixels */
#define MAXHEIGHT 300   /* In lines */

int pixelwidth,pixelheight;
char *progname;

XEvent *XXm_queue[XMOUSEBUFSIZE];
int XXm_queue_num, XXm_queue_in, XXm_queue_out;

char *XXcurrentfont;
XFontStruct *fontinfo;
Font XXfid;
int XXfontw, XXfonth, XXbase, XXisColor;

/* Nonzero means Emacs has explicit keyboard focus.  */
int x_focus_flag;

Colormap XXColorMap;
char *default_window;
int configure_pending;
extern int initialized;
extern int screen_width, screen_height;

/* Function for init_keyboard to call with no args (if nonzero).  */
extern void (*keyboard_init_hook) ();

extern char *alternate_display;
extern int xargc;
extern char **xargv;

int XXdebug;
int XXpid;

int WindowMapped;

char  *XXidentity;      /* Resource name of this invocation of Emacs */
static char  *XXicon_name;      /* user-supplied icon info */
static int   XXicon_usebitmap;  /* Use bitmap or not */
static char  *XXheader;         /* user-supplied window header info */

static int flexlines;           /* last line affected by dellines or
                                 * inslines functions */
int VisibleX, VisibleY;         /* genuine location of cursor on screen
                                 * if it is there */

/* Last cursor position specified by move_cursor.
   During an update, this does not display a cursor on the screen;
   But it controls the position that is output.  */
static int local_cursor_hpos;
static int local_cursor_vpos;

static int SavedX, SavedY;      /* Where the cursor was before update
                                 * started */

int CursorExists;               /* during updates cursor is turned off */
int CursorOutline;              /* when the pointer is not in the Emacs
                                 * widow the cursor should be drawn in
                                 * outline form a la xterm */
static int InUpdate;            /* many of functions here may be invoked
                                 * even if no update in progress; when
                                 * no update is in progress the action
                                 * can be slightly different */

Display *XXdisplay;
int XXscreen;
Window XXwindow;
GC XXgc_norm,XXgc_rev,XXgc_curs,XXgc_temp;
XGCValues XXgcv;
Cursor EmacsCursor;
Pixmap SinkPixmap, SinkMaskPixmap;

char *fore_color;       /* Variables to store color names */
char *back_color;
char *brdr_color;
char *curs_color;
char *mous_color;

unsigned long fore;     /* Variables to store pixel values */
unsigned long back;
unsigned long brdr;
unsigned long curs;

char *desiredwindow;

int CurHL;                      /* Current Highlighting (ala mode line) */

int XXborder;                   /* Window border width */
int XXInternalBorder;           /* Internal border width */
int updated[MAXHEIGHT];

static char  *temp_font;                /* needed because of loading hacks */
static char  *temp_reverseVideo;
static char  *temp_borderWidth;
static char  *temp_internalBorder;
static char  *temp_useBitmap;

struct _xdeftab
{
  char *iname;                  /* instance name */
  char *cname;                  /* class name (fake it) */
  char **varp;                  /* variable to set */

};

static struct _xdeftab xDefaultsValueTable[]
 = {
     { "reverseVideo",        "ReverseVideo",               &temp_reverseVideo },
     { "borderWidth", "BorderWidth",                &temp_borderWidth },
     { "internalBorder","BorderWidth",              &temp_internalBorder },
     { "bitmapIcon",  "BitmapIcon",         &temp_useBitmap },
     { "borderColor", "BorderColor",                &brdr_color },
     { "background",  "Background",         &back_color },
     { "foreground",  "Foreground",         &fore_color },
     { "pointerColor",        "Foreground",         &mous_color },
     { "cursorColor", "Foreground",         &curs_color },
     { "font",                "Font",                       &temp_font },
     { "geometry",    "Geometry",           &desiredwindow },
     { "title",               "Title",              &XXheader },
     { "iconName",    "Title",              &XXicon_name },
     { NULL,            NULL,                   NULL }
   };

int (*handler)();

static void x_init_1 ();

char *rindex();

/* HLmode -- Changes the GX function for output strings.  Could be used to
 * change font.  Check an XText library function call.
 */

HLmode (new)
     int new;
{
        extern Lisp_Object inverse_video;

        CurHL = new;

}

/* External interface to control of standout mode.
   Call this when about to modify line at position VPOS
   and not change whether it is highlighted.  */

XTreassert_line_highlight (highlight, vpos)
     int highlight, vpos;
{
        HLmode (highlight);

}

/* Call this when about to modify line at position VPOS
   and change whether it is highlighted.  */

XTchange_line_highlight (new_highlight, vpos, first_unused_hpos)
     int new_highlight, vpos, first_unused_hpos;
{
        HLmode (new_highlight);
        XTmove_cursor (vpos, 0);
        x_clear_end_of_line (0);

}

/* Used for starting or restarting (after suspension) the X window.  Puts the
 * cursor in a known place, update does not begin with this routine but only
 * with a call to redisplay.
 */

XTset_terminal_modes ()
{
        int stuffpending;
#ifdef XDEBUG
        fprintf (stderr, "XTset_terminal_modes\n");
#endif

        InUpdate = 0;
        stuffpending = 0;
        if (!initialized) {
                CursorExists = 0;
                CursorOutline = 1;
                VisibleX = 0;
                VisibleY = 0;
        }
        XTclear_screen ();

}

/* XTmove_cursor moves the cursor to the correct location and checks whether an
 * update is in progress in order to toggle it on.
 */

XTmove_cursor (row, col)
     register int row,
...

read more »

 
 
 

getting Delete key to DELETE on RS6000

Post by Milt Epste » Sun, 25 Aug 1991 07:21:13


I'm updating my post a bit (since I figured some things out), and
crossposting it to comp.windows.x, since it now seems relevant over
there.


Quote:>On the RS6000's I use, I'm trying to figure out how to get the Delete
>key to be DELETE (I have erase set to ^? and I use emacs -- so I don't
>want to use Ctrl-H for destructive backspace).  Currently, Backspace
>and Shift-Backspace generate Ctrl-H, Ctrl-Backspace generates DELETE,
>and Delete generates Ctrl-[ [ P (same as Esc [ P).

>Looking through the documentation, it looks like I may be able to use
>chkeymap, but I couldn't figure out how to use it (I couldn't find the
>section of the manual which gave the keyboard position codes).  My
>understanding is that each key on the keyboard has a keyboard position
>code, so if I know the keyboard position code for the Delete key, I
>could get the behavior I desire with a command like:

>     chkeymap -tc -sb -kNNN -d127

>(where NNN is the keyboard position code for the Delete key; 127 is
>the ASCII code for DELETE).  Or perhaps I am misunderstadning how this
>command works.

>I would like this change to stay in effect when I use X also.

Well, I did figure out what the keyboard position code for the Delete
key was, by experimentation -- it's 76.  So, the following allows me
to set up the Delete key to DELETE, when I'm on the HFT console (I
don't think the order or arguments matter):

     chkeymap -k76 -sb -tc -d127

However, since X remaps the keys, this change is lost when I start up
X, so now I would like to know how to set it up in X.  Probably I need
to use xmodmap, but I'm having trouble figuring it out.

Quote:>For when I use X, I tried to use xmodmap to change this behavior.  I
>gave it the following command

>     keysym BackSpace = BackSpace Delete

>in the hopes that I could get Shift-Backspace to be DELETE, but all
>that did was make Shift-Backspace generate Ctrl-[ [ P.

>If anyone can tell me how to do this or explain how this key mapping
>stuff works, I would appreciate it.

>Thanks.

--
Milt Epstein
Department of Computer Science
University of Illinois

 
 
 

getting Delete key to DELETE on RS6000

Post by Hemant Sh » Mon, 26 Aug 1991 04:08:09


To use backspace as a delete under X add the following to your .Xdefaults file :

*aixterm.Translations: #override \
        <Key>BackSpace:         string(0x7f) \n\

Now restart mwm, backspace will now act as delete key in aixterm.

Hope this helps :-)

-------------------------------------------------------------------------------
Hemant Shah
Fermilab  
ACCESS/System Integration


 Voice : (708) 840-8071
   Fax : (708) 840-2783
-------------------------------------------------------------------------------

 
 
 

1. Remapping Keys (want delete key to delete etc!)

Hi,

I would have thought linux being Intel based that the keyboard mappings would
work "correctly".  I have 4 linux books and none help me in this.

I have created a ".input.rc" which gets my full screen bash shell working much
better with home, end and delete keys working (I was following a poor example
without any explanations).  This stuffs up or does not work correctly in
xwindows, xterm etc.

Question 1
~~~~~~~
Can I up the keyboard repeat rate from the current snails pace?

Question 2
~~~~~~~
Surely I can download something from somewhere or get information on the
mapping of keys to "normal" PC mappings.  Unless linux wants to only attract
unix people it would seem to me that it will need to correct this problem....

Thanks for any help,
Dennis

----------------------------

Melbourne, AUSTRALIA.

http://www.labyrinth.net.au/~dbareis/index.htm

 - Contains heaps of my own FREE software (OS/2, Windows, DOS & Linux):
   * PPWIZARD (HTML/REXX/generic preprocessor - #define, #include, #import, #if)
     Powerful macros, programmable, import SQL, auto tag examples, Text to HTML, template/style sheet design.
     You WILL NOT find an easier to use or more powerful preprocessor than PPWIZARD.
     Tested on OS/2, Windows, DOS & Linux (probably any Unix OK - if not help me make it so).
   * Icon for single OS/2 archive on following boot (also auto archive every 'x' days).
   * REXX "compiler" - Many options, compresses, encrypts (no one can see/modify source).
   * Program manipulation by Window or Switch list title (with wildcards)
   * Prevent a floppy in boot drive stopping boot off hard disk.
   * Heaps more...
 - Some source code and programmers links.  Regina Information (including porting from OS/2)
   * Pure REXX code for CRC16 & CRC32 routines.
 - Heaps of COMMENTED OS/2, HTML, Java and other links
----------------------------

2. Java 2.x for AIX?

3. How to make Delete key delete forward?

4. alternate placement of mail file

5. How to (setq delete-key-deletes-forward t) in syscons?

6. Where I can get latest DBI & DBD

7. how can my delete key delete?

8. internal ftp server

9. How Do I Get Delete Key to delete?

10. delete key = delete-next-char?

11. The IBM rs6000 delete key (and anyone got x11r4)

12. Getting KEYS to work (DELETE, BACKSPACE)

13. getting the delete key to work.