Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!tinman.cis.ohio-state.edu!bob From: bob@tinman.cis.ohio-state.edu (Bob Sutterfield) Newsgroups: gnu.emacs Subject: Re: Prefixes for function keys Message-ID: Date: 3 Apr 89 15:04:54 GMT References: <26575@cornell.UUCP> Sender: news@tut.cis.ohio-state.edu Distribution: gnu Organization: The Ohio State University Dept of Computer & Information Science Lines: 55 In-reply-to: allan@svax.cs.cornell.edu's message of 31 Mar 89 20:29:58 GMT In article <26575@cornell.UUCP> allan@svax.cs.cornell.edu (James Allan) writes: I'm a gnu-emacs novice who wants to set things up so that I can use the function keys on my Sun3/60 under X11. The keys generate a sequence of the form "[123z" where "123" can be pretty much any number. Here's what Chris Lott worked up for our students, when their instructor wanted them to be able to use the arrow keys. You should be able to figure out from this, how to program all the others as well. It seems that sometimes you'll see VT100-mapping keycodes from the arrow keys, and other times you'll see the numbers. That may depend upon what version of what window system you're using, and what version of the keyboard ROMs it knows how to talk to at initialization time. Anyway, stick this in your .emacs and enjoy! ;; ; arrow key remappings ; unmap the escape sequence esc-left_bracket (global-unset-key "\e[") ;; ; esc-[-A is up arrow, vt100 mapping (global-set-key "\e[A" 'previous-line) ; esc-[-215z is up arrow, sun kbd mapping (global-set-key "\e[215z" 'previous-line) ;; ; esc-[-B is down arrow, vt100 mapping (global-set-key "\e[B" 'next-line) ; esc-[-221z is up arrow, sun kbd mapping (global-set-key "\e[221z" 'next-line) ;; ; esc-[-C is right arrow, vt100 mapping (global-set-key "\e[C" 'forward-char) ; esc-[-219z is right arrow, sun kbd mapping (global-set-key "\e[219z" 'forward-char) ;; ; esc-[-D is left arrow, vt100 mapping (global-set-key "\e[D" 'backward-char) ; esc-[-217z is left arrow, sun kbd mapping (global-set-key "\e[217z" 'backward-char) ;; ; map r11 key to set mark - a safe null command for key between arrow keys (global-set-key "\e[218z" 'set-mark-command) ;; ; R15 key - move down in file (global-set-key "\e[222z" 'scroll-up) ; R9 key - move up in file (global-set-key "\e[216z" 'scroll-down) ; R7 key - go to top (global-set-key "\e[214z" 'beginning-of-buffer) ; R13 key - go to end (global-set-key "\e[220z" 'end-of-buffer) ;;