Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: Xterm translations in vi/nn Message-ID: <9012211842.AA07021@Larry.McRCIM.McGill.EDU> Date: 21 Dec 90 18:42:57 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 54 >> My normal windows are xterms. I have a numeric keypad which normally >> produces the correct characters - for instance pressing 'KP_0' >> generates a '0'. But when I start up vi (and nn) in this xterm >> window, the KP_0 generates the corresponding vt100 escape code (I >> think) (eg - KP_0 -> ^[Op). > The explanation is that xterm is correctly emulating a VT100. The > VT100 keypad has several modes, which are controlled by ESC > sequences. When vi (or any curses-based application) starts up, it > reads the termcap/terminfo for the terminal and sends sequences > defined there for "begin keypad application." Well, "begin full-screen application". You could delete the "application keypad mode" sequence from the :ti: capability. >> How can I get KP_0 to generate a 0 in vi (other than with a map! in >> my .exrc). You might simply xmodmap - << EOF keysym KP_0 = 0 keysym KP_1 = 1 keysym KP_2 = 2 keysym KP_3 = 3 keysym KP_4 = 4 keysym KP_5 = 5 keysym KP_6 = 6 keysym KP_7 = 7 keysym KP_8 = 8 keysym KP_9 = 9 EOF Then they should be indistinguishable from the main digit keys. If you want to get really fancy, you could set the shifted keys as well; if your shifted digits match mine, this would then give xmodmap - << EOF ksysym KP_0 = 0 parenright ksysym KP_1 = 1 exclam ksysym KP_2 = 2 at ksysym KP_3 = 3 numbersign ksysym KP_4 = 4 dollar ksysym KP_5 = 5 percent ksysym KP_6 = 6 asciicircum ksysym KP_7 = 7 ampersand ksysym KP_8 = 8 asterisk ksysym KP_9 = 9 parenleft EOF der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu