From owner-freebsd-questions@FreeBSD.ORG Fri Oct 7 19:01:31 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 85FAC1065676 for ; Fri, 7 Oct 2011 19:01:31 +0000 (UTC) (envelope-from kline@thought.org) Received: from thought.org (plato.thought.org [209.180.213.209]) by mx1.freebsd.org (Postfix) with ESMTP id 5ADD28FC28 for ; Fri, 7 Oct 2011 19:01:30 +0000 (UTC) Received: by thought.org (Postfix, from userid 1001) id C7750E809D2; Fri, 7 Oct 2011 12:01:29 -0700 (PDT) Date: Fri, 7 Oct 2011 12:01:29 -0700 From: Gary Kline To: Polytropon Message-ID: <20111007190129.GA21584@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111007095620.8b78e334.freebsd@edvax.de> Organization: Thought Unlimited. Public service Unix since 1986. Of_Interest: With 25 years of service to the Unix community. User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-questions@freebsd.org, Robert Bonomi 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 19:01:31 -0000 On Fri, Oct 07, 2011 at 09:56:20AM +0200, Polytropon wrote: > Date: Fri, 7 Oct 2011 09:56:20 +0200 > From: Polytropon > Subject: Re: OT: how to tell when i've hit a Fn key? > To: Robert Bonomi > Cc: freebsd-questions@freebsd.org > X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) See 90+ lines below! > > On Fri, 7 Oct 2011 02:36:49 -0500 (CDT), Robert Bonomi wrote: > > > > > 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. > > That's what I wanted to suggest. :-) > The NCurses function getch() deals well with the > key macros defined here, so no need to deal with > the zero-byte manually. > > > > > 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) > > The port misc/kbdscan can be used to obtain keyboard > information; however: "Please note that this program > will only work in the FreeBSD console", but it works > perfectly in the FreeBSD console (text mode); after > a certain time-out, the program automatically quits > as it will capture _all_ keys like Alt+F(n), ^C and > the like. Sadly, there is no manpage that states this > simple fact. :-( > > In most cases, KEY_F(1) - KEY_F(12) will map to the > physical F1 to F12 keys, KEY_F(13) - KEY_F(24) to > the Shift+F1 to Shift+F12 keys; this mechanism has been > the default idea of providing 24 function keys to keyboards > that only offer 12 of them. But as many things that have > proven to work flawlessly, this might have changed into > something broken, erm "more modern"... > > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" well, thanks to everyone who posted. if i had written this a few days ago i would have saved the concrete in my driveway that is now lying, cracked by my head. i still have a few mile--maybe lightyears--to go, but slowly...slowly this is coming back. when ken arnold was working on the early versions of curses i was still learning C. i dont remembr any arrow keys on the old AMD3a terms so wasn't that interested in things-termcap. but what i'm doing with my clicky-keys for those FEW of use who like feedback =proves= that, yes, there are new and interesting uses for curses. :_) i have writeen the rough draft of a curses [or Ncurses] test program that gets rid of the rat-a-tat-tat WAV response whenever i hit a non-std key. say "home" or up-arrow, or F12 or Scroll Lock. how long it will be before i've joined this test program with my kclick stuff is unknown. maybe 45 mins, maybe 75 years. [[that's IFF they've got programming in hell]] **Change-of-topic: the GUI editor that has vi bindings is kate. unfortunately, kate has no abbrevs. i asked the principal developer about that. no answer. his site has a .de suffix. (i was wondering if he doesn't speak english. he may be like me, a linguistic dimwit. then again, he may not think much of my idea. or overwhelingly busy... .) anyway, for now, i think having a GUI editor that the speech disabled can use to have their computer speak what they type is better than using something like vim/gvim. the One Laptop per Child bunch are still interested. their device has a membrane kybd. i have heard that the keys are somewhat hard to use. IF there is another GUI editor that has builtin abbreviations that you guys know of, please senf up some smoke signals:) -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book: http://www.thought.org The 8.51a release of Jottings: http://jottings.thought.org