From owner-freebsd-questions@FreeBSD.ORG Tue Feb 24 23:22:52 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70D0A106564A for ; Tue, 24 Feb 2009 23:22:52 +0000 (UTC) (envelope-from talon@lpthe.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id 0543B8FC26 for ; Tue, 24 Feb 2009 23:22:51 +0000 (UTC) (envelope-from talon@lpthe.jussieu.fr) Received: from parthe.lpthe.jussieu.fr (parthe.lpthe.jussieu.fr [134.157.10.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id n1ONMoT3067198 for ; Wed, 25 Feb 2009 00:22:50 +0100 (CET) X-Ids: 164 Received: from niobe.lpthe.jussieu.fr (niobe.lpthe.jussieu.fr [134.157.10.41]) by parthe.lpthe.jussieu.fr (Postfix) with ESMTP id 0ACAF89CEC for ; Wed, 25 Feb 2009 00:22:49 +0100 (CET) Received: by niobe.lpthe.jussieu.fr (Postfix, from userid 2005) id D122115; Wed, 25 Feb 2009 00:22:48 +0100 (CET) Date: Wed, 25 Feb 2009 00:22:48 +0100 From: Michel Talon To: freebsd-questions@freebsd.org Message-ID: <20090224232248.GA88129@lpthe.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (shiva.jussieu.fr [134.157.0.164]); Wed, 25 Feb 2009 00:22:50 +0100 (CET) X-Virus-Scanned: ClamAV 0.94.2/9041/Tue Feb 24 17:21:07 2009 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail2.jussieu.fr with ID 49A4814A.001 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 49A4814A.001/134.157.10.1/parthe.lpthe.jussieu.fr/parthe.lpthe.jussieu.fr/ X-j-chkmail-Score: MSGID : 49A4814A.001 on jchkmail2.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.019 -> S=0.019 X-j-chkmail-Status: Ham Subject: Re: Determining scancodes for obscure keyboard to modify keymap X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 23:22:52 -0000 Bill Campbell wrote: > As somebody else pointed out, xev is your friend. > > I am attaching the .Xmodmap file I use on OS X to allow the > numeric keypad on the Microsoft 4000 natural keybaord to do the > Right Thing(tm) (e.g. send numbers when using python curses). Scancodes have nothing (*) to do with keycodes. Xev will be of absolutely no help for remapping if it doesn't see the key at all, which frequently occurs with exotic keys. As Patrick said, you need to dig into the OS keyboard driver to solve the problem when working on the console. On Linux it is easier there are commands to detect and remap scancodes. Getting those keys working under X is still another problem, it may be that you have to hack the keyboard controller of the X server to do that. In other words, it is extremely inconvenient. Windows works directly with scancodes and they can be remapped in the registry, with all the problems this entails. On the other hand one can find scancode documentation on Microsoft site. (*) more precisely there is a partial mapping of scancodes to keycodes. xmodmap manages a second mapping from keycodes to symbols, as recognized by your X applications. -- Michel TALON