From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 09:20:53 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0174106566B for ; Fri, 23 Apr 2010 09:20:53 +0000 (UTC) (envelope-from mc@hack.org) Received: from ecki.hack.org (ecki.hack.org [IPv6:2001:888:22b3::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9808FC16 for ; Fri, 23 Apr 2010 09:20:51 +0000 (UTC) Received: from localhost ([::1] helo=brain.hack.org) by ecki.hack.org with smtp id 1O5F46-0000g3-Ru for freebsd-hackers@freebsd.org; Fri, 23 Apr 2010 11:20:50 +0200 Received: by brain.hack.org (sSMTP sendmail emulation); Fri, 23 Apr 2010 11:20:50 +0200 From: Michael Cardell Widerkrantz To: freebsd-hackers@freebsd.org Organization: Temple of the Moby Hack Date: Fri, 23 Apr 2010 11:20:50 +0200 Message-ID: <868w8e5xu5.fsf@brain.hack.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Keyboard scancodes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2010 09:20:54 -0000 I was recently given an original Happy Hacking Keyboard. As I sometimes work in the FreeBSD console, I wanted to have my usual console keymap adjusted to the new keyboard, but didn't know the scancode for the HHKB meta key (the diamond key). I couldn't find any program in base or ports that would show me the scancodes, so I ended up writing my own: http://hack.org/mc/hacks/kbdscan/ It's little more than a quick hack done while my baby daughter was napping, but it works for my purposes. The program sets the FreeBSD console keyboard in raw scancode mode and the terminal in raw mode without echo. It then shows scancodes of keys pressed and released. Five seconds of inactivity resets the keyboard and terminal to the original modes and quits the program. Nota bene: If the process receives any signals, it will currently leave the keyboard and console in the raw mode. When I was searching for information about this, I found a lot of similar questions on freebsd-questions and in other fora about similar problems, so I thought I should post about it. Please excuse me if this is inappropriate. Happy hacking, MC. -- http://hack.org/mc/ Use plain text e-mail, please. OpenPGP welcome, 0xE4C92FA5.