From owner-freebsd-questions@FreeBSD.ORG Wed Mar 2 05:16:06 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0019316A4CE for ; Wed, 2 Mar 2005 05:16:05 +0000 (GMT) Received: from smtp.io.com (smtp.io.com [209.198.128.91]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D21F43D5F for ; Wed, 2 Mar 2005 05:16:05 +0000 (GMT) (envelope-from eighner@io.com) Received: from io.com (206-224-83-100-dialup.io.com [206.224.83.100]) by smtp.io.com (8.13.1/8.13.1) with SMTP id j225G2nw019497; Tue, 1 Mar 2005 23:16:03 -0600 (CST) (envelope-from eighner@io.com) Date: Tue, 1 Mar 2005 23:11:18 -0600 (CST) From: Lars Eighner To: Alejandro Pulver In-Reply-To: <20050301194338.3a49611d@ale.varnet.bsd> Message-ID: <20050301220822.F8622@goodwill.io.com> References: <20050301194338.3a49611d@ale.varnet.bsd> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.83/742/Tue Mar 1 19:05:59 2005 on smtp.io.com X-Virus-Status: Clean cc: freebsd-questions Subject: Re: Using META and DEL keys in console X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2005 05:16:06 -0000 On Tue, 1 Mar 2005, Alejandro Pulver wrote: > Hello, > > I have a PS/2 PC-101 keyboard. > > I would like to use my META (ALT in my keyboard) key instead of ESC in > console mode. META works fine in an xterm. I also would like to use DEL > and others. The console keymaps are in /usr/share/syscons/keymaps. You can edit whichever keymap you are using with a flat ascii editor. To get a key to send the familiar ^?, enter del in the keymap. Not all applications, however, will do the expected thing with this, and you will have to consult the documentation for the individual applications to see whether they can be configured to do what you expect from a delete key. For backspace, bs, for meta, meta, esc for escape. Note that you can set the left and right Alt keys to different things, and that keypad Del/. key can be different from the Delete key. You almost certainly do not want to mess with terminfo. If you use the the bash shell, you can see what a key is currently sending by entering C-v at the command prompt. > I read something in the manual pages of terminfo(5), gettytab(5), > etc. > > I tried the following options: > > :km:smm:dc: > > But I am having these thoubles: > > 1) My ALT key did not work and the DEL key acts as BACKSPACE (C-h), > but I would like to use it as C-d. C-d is eot in the console keymap if you would rather have that than the ^? which is del. > 2) Some strange thing happens with Emacs in console mode: when I press > DEL, it is interpreted (literally) as C-h, and C-h is used as > BACKSPACE. And C-d acts as DEL. Switching to the emacs keymap might help you. > 3) Also DEL does not do anything in xterm. Make changes to xterm mappings in your .Xdefaults file, such as: !! xterm keymappings *XTerm*VT100.translations: #override \n\ KP_Delete: string(0x7f) \n\ Naturally, you can make these strings whatever you want. > Is there a more descriptive documentation of the terminal capabilities > listed in terminfo(5)? Yes, you can google for many books worth of material, but it is not particularly germane to what you want to do if you are running a PC with a PC keyboard, and not trying to connect some ancient dumb terminal. > Is there a standard configuration for PS/2 PC-101 keyboards? Unfortunately there are a lot of them. > Does xterm use a different configuration from console terminals? Yes. X applications are meant to run on X, and X is meant to run on a variety of machines. Any relationship between xterm and the machine's native terminal is purely coincidental. (In particular, xterm is meant to be out of the box compatible with the very old VT100 standard - which never was native to any PC operating system.) You can get xterm and the console keyboard to behave mostly the same way - and get that way to be what you want - by editing .Xdefaults and the syscons keymap you are using (probably both). But that doesn't mean that every application will behave as you think it should. -- Lars Eighner eighner@io.com http://www.io.com/~eighner/index.html 8800 N IH35 APT 1191 AUSTIN TX 78753-5266