Article View: gnu.emacs.bug
Article #1630Rebinding Arrow Keys
From: Stewart Clamen
Date: Tue, 25 Apr 1989 22:41
Date: Tue, 25 Apr 1989 22:41
55 lines
1763 bytes
1763 bytes
One of my users has rebound ^F, but wants the rightarrow key to still
map to 'forward-char. Problem is, the GNU Emacs/X interface
translates the arrow keys DIRECTLY into ^F/^B/^P/^N. Here's the code,
from internal_socket_read() in src/x11term.c .
-----
if (IsFunctionKey(keysym) ||
IsMiscFunctionKey(keysym)) {
strcpy(mapping_buf,"[");
strcat(mapping_buf,stringFuncVal(keysym));
#ifdef sun
strcat(mapping_buf,"z");
#else
strcat(mapping_buf,"~");
#endif /* sun */
nbytes = strlen(mapping_buf);
}
else {
switch (keysym) {
case XK_Left:
strcpy(mapping_buf,"\002");
nbytes = 1;
break;
case XK_Right:
strcpy(mapping_buf,"\006");
nbytes = 1;
break;
case XK_Up:
strcpy(mapping_buf,"\020");
nbytes = 1;
break;
case XK_Down:
strcpy(mapping_buf,"\016");
nbytes = 1;
break;
}
}
-----
A similar thing is done in the X10 support (src/xterm.c). I realize
that an easy fix would be to remove the test and map all non-standard
keys to the funny escape sequences. Any opinions on whether this is a
good thing to do?
--
------------------------------------------------------------------------------
Stewart M. Clamen
School of Computer Science, Carnegie Mellon University
Pittsburgh, PA 15213-3890
INTERNET: clamen@CS.CMU.EDU
USENET: ...!uunet!"clamen@cs.cmu.edu"
--
Technical Details
Message-ID:
<CLAMEN.89Apr25184123@CLAMEN.AVALON.CS.CMU.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!pt.cs.cmu.edu!pt!clamenShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!pt.cs.cmu.edu!pt!clamen From: clamen@CLAMEN.AVALON.CS.CMU.EDU (Stewart Clamen) Newsgroups: gnu.emacs.bug Subject: Rebinding Arrow Keys Message-ID: <CLAMEN.89Apr25184123@CLAMEN.AVALON.CS.CMU.EDU> Date: 25 Apr 89 22:41:23 GMT Distribution: gnu Organization: Carnegie Mellon University Lines: 55