From owner-freebsd-questions@FreeBSD.ORG Fri Oct 7 07:36:41 2011 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 E2570106566C for ; Fri, 7 Oct 2011 07:36:41 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id B24F48FC12 for ; Fri, 7 Oct 2011 07:36:41 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id p977anOs027817 for freebsd-questions@freebsd.org; Fri, 7 Oct 2011 02:36:49 -0500 (CDT) Date: Fri, 7 Oct 2011 02:36:49 -0500 (CDT) From: Robert Bonomi Message-Id: <201110070736.p977anOs027817@mail.r-bonomi.com> To: freebsd-questions@freebsd.org In-Reply-To: <20111007091857.33b47b19.freebsd@edvax.de> Subject: Re: OT: how to tell when i've hit a Fn key? 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: Fri, 07 Oct 2011 07:36:42 -0000 > Date: Fri, 7 Oct 2011 09:18:57 +0200 > From: Polytropon > Cc: FreeBSD Mailing List > Subject: Re: OT: how to tell when i've hit a Fn key? > > On Thu, 6 Oct 2011 15:41:17 -0700, Gary Kline wrote: > > > > I've got a 103-key keyboard. most of them produce the right WAV > > file. i was having some trouble with the arrow key, but think i've > > found a resolution. next are the Function key, F1 to F12. > > > > anybody on-list familiar with curses and can help me with this? > > right now, most of the function keys output 4 clicks [!]. > > Capturing PF keys is very easy with ncurses. > The macro KEY_F(n), n=1..12, can be checked > as the result of the getch() function. The > other "special keys" also have such macros > assigned. You can find them in the header > file /usr/local/include/ncurses/ncurses.h > around line 1400. No need to go chasing that far. #include pulls in the macro definitions as well. KEY_F(n) supports 'n' values in the range from 0 to 64. value of this macro is a range of 64 consecutive values, starting with KEY_F0 -- which is defined as *octal* 0410 it may take a little experimenting to see which key (plus modifier key(s) like 'shift','control', etc, map to which 'n' values)