From owner-freebsd-usb@FreeBSD.ORG Sun Mar 14 14:46:07 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EE88106566B; Sun, 14 Mar 2010 14:46:07 +0000 (UTC) (envelope-from kaiwang27@gmail.com) Received: from mail-ew0-f228.google.com (mail-ew0-f228.google.com [209.85.219.228]) by mx1.freebsd.org (Postfix) with ESMTP id EEA5E8FC19; Sun, 14 Mar 2010 14:46:06 +0000 (UTC) Received: by ewy28 with SMTP id 28so486437ewy.13 for ; Sun, 14 Mar 2010 07:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received :x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Cd8F69hWFGg99HetGf6gdJ130Bvv9yrPreyerhrXE04=; b=iY1boX/saMF5zRbjTnBEcCA4+TjsmvZcTXeFPoROC/SYuzevfN/mPyDK/08MvU/1Mk 5LNKrFMZm9TjhntROb6jfYOdwEEdNFUPSUKYdw8Uu/5B2rezBXs/peysBE3Zw1a/dt7r gFRItTzgjvwEIT2oLx5jG2++9KBrbaa9i5R9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; b=v3iZyYD5Z24pLf1etEY6wX6jIswhYYW5Vy654w+KITs5oXx9Zhwe4acd5uY4zz62yd OXV7XuTt++Azdi3hJ5cRXGnhKzE28l3cyOM265MQaYTGMU2OHU1CZF7HGvKbzAEKCS3m 4SlUObji0Kh71Eatf51VRyLOKc7lzDC0wtvUQ= Received: by 10.213.100.4 with SMTP id w4mr1592598ebn.53.1268577965678; Sun, 14 Mar 2010 07:46:05 -0700 (PDT) Received: from localhost (81-233-38-26-no36.tbcn.telia.com [81.233.38.26]) by mx.google.com with ESMTPS id 16sm2061214ewy.3.2010.03.14.07.46.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Mar 2010 07:46:04 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=localhost.my.domain) by localhost with esmtp (Exim 4.71 (FreeBSD)) (envelope-from ) id 1Nqp4t-0000xn-4T; Sun, 14 Mar 2010 15:46:03 +0100 Received: (from kaiw@localhost) by localhost.my.domain (8.14.3/8.14.3/Submit) id o2EEk1Z5003706; Sun, 14 Mar 2010 15:46:01 +0100 (CET) (envelope-from kaiwang27@gmail.com) X-Authentication-Warning: localhost.my.domain: kaiw set sender to kaiwang27@gmail.com using -f Date: Sun, 14 Mar 2010 15:46:01 +0100 From: Kai Wang To: Steven Noonan Message-ID: <20100314144601.GA2534@viskning> References: <201003141030.o2EAU40v018339@freefall.freebsd.org> <201003141448.30747.hselasky@c2i.net> <201003141527.37644.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-gnats-submit@freebsd.org, Christoph Langguth , freebsd-usb@freebsd.org Subject: Re: usb/144414: Apple "Fn" key doesn't work properly X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2010 14:46:07 -0000 On Sun, Mar 14, 2010 at 06:37:04AM -0800, Steven Noonan wrote: > On Sun, Mar 14, 2010 at 6:27 AM, Hans Petter Selasky wrote: > > On Sunday 14 March 2010 15:01:39 Steven Noonan wrote: > >> On Sun, Mar 14, 2010 at 5:48 AM, Hans Petter Selasky > > wrote: > >> > On Sunday 14 March 2010 14:22:33 Steven Noonan wrote: > >> >> On Sun, Mar 14, 2010 at 3:01 AM, Hans Petter Selasky > >> > > >> > wrote: > >> >> > On Sunday 14 March 2010 11:30:04 Steven Noonan wrote: > >> >> >> The following reply was made to PR usb/144414; it has been noted by > >> >> >> GNATS. > >> >> >> > >> >> >> From: Steven Noonan > >> >> >> To: perryh@pluto.rain.com > >> >> >> Cc: freebsd-usb@freebsd.org, freebsd-gnats-submit@freebsd.org > >> >> >> Subject: Re: usb/144414: Apple "Fn" key doesn't work properly > >> >> >> Date: Sun, 14 Mar 2010 03:26:19 -0700 > >> >> >> > >> >> >>  On Thu, Mar 4, 2010 at 12:01 AM, Steven Noonan > >> >> >> wrot= > >> >> >> > >> >> >>  e: > >> >> >>  > On Wed, Mar 3, 2010 at 11:00 PM, Steven Noonan > >> >> >> > wr= > >> >> >> > >> >> >>  ote: > >> >> >>  >> On Wed, Mar 3, 2010 at 10:36 PM, =C2=A0 > >> >> >> wrote: >>> Steven Noonan wrote: > >> >> >>  >>>> Interestingly, my tilde key doesn't work either (though the key > >> >> >>  >>>> press is detected, no character shows when the key is pressed). > >> >> >>  >>> > >> >> >>  >>> Any chance it is configured as a "dead" key? =C2=A0If you press > >> >> >>  >>> tilde followed by n do you get an n with a tilde over it? > >> >> >>  >> > >> >> >>  >> Nope. It simply does nothing in the console. > >> >> >>  >> > >> >> >>  >> But in X11, it does something very odd. Shift+Tilde Key gives me > >> >> >> '>', >> and Tilde Key gives me '<'. And Alt+Tilde gives me... What? I > >> >> >> don't >> even know what action. It's grabbing some arbitrary command > >> >> >> in my >> .bash_history. It gave me the first item in my .bash_history > >> >> >> the first >> time I tried it. Then I tried an arbitrary command > >> >> >> ("echo"), and then >> Alt+Tilde gave me the second command in my > >> >> >> .bash_history. Whaa? > >> >> >> > >> >> >>  Any more ideas/news on this from anyone? > >> >> >> > >> >> >>  The tilde key thing is especially irritating. > >> >> > > >> >> > static uint8_t > >> >> > ukbd_apple_swap(uint8_t keycode) { > >> >> >        switch (keycode) { > >> >> >        case 0x35: return 0x64; > >> >> >        case 0x64: return 0x35; > >> >> >        default: return keycode; > >> >> >        } > >> >> > } > >> >> > > >> >> > Can you try to change the function above in ukbd.c to only return > >> >> > keycode? Any difference? > >> >> > >> >> Yep, commenting the two case lines brought my tilde key back. Any idea > >> >> what the ukbd_apple_swap() function was _supposed_ to be doing? > >> >> > >> >> Also, there's only one thing left (input-wise) that I can't get to > >> >> work, and that's the 'delete' key (Fn+Backspace). I'm pretty certain > >> >> that it's not a problem with Fn+Backspace failing to map to Delete, > >> >> because my non-Mac i386 box has the same problem. > >> >> > >> >> Everything I read online keeps saying to muck with an .inputrc file > >> >> (for bash, anyway), but I haven't been able to get it to work. Places > >> >> I've looked have said to add this to .inputrc: > >> >> > >> >> "\e[3~": delete-char > >> >> > >> >> But this seems to have no effect (and I tried bind -f .inputrc in case > >> >> my INPUTRC environment variable wasn't working). Is there something > >> >> FreeBSD-specific I'm not seeing, or what? > >> >> > >> >> - Steven > >> > > >> > Hi Steven, > >> > > >> > Can you talk this over with Christoph and send me a patch when you > >> > agreed? He's the one that made the Apple-SWAP key patch. Meanwhile I > >> > suggest the following patch: > >> > > >> > ==== //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#47 - > >> > src/sys/dev/usb/input/ukbd.c ==== > >> > @@ -896,8 +896,7 @@ > >> >                    hid_input, 0, &sc->sc_loc_apple_fn, &flags, > >> >                    &temp_id)) { > >> >                        if (flags & HIO_VARIABLE) > >> > -                               sc->sc_flags |= UKBD_FLAG_APPLE_FN | > >> > -                                   UKBD_FLAG_APPLE_SWAP; > >> > +                               sc->sc_flags |= UKBD_FLAG_APPLE_FN; > >> >                        DPRINTFN(1, "Found Apple FN-key\n"); > >> >                        apple_keys = 1; > >> >                        sc->sc_kbd_id = temp_id; > >> > > >> > > >> > The hardware that Christoph was using had an Eject-key, while yours > >> > didn't. I think the patch above will make both cases work. > >> > > >> > Christoph, do you have any comments? > >> > > >> > http://p4db.freebsd.org/fileViewer.cgi?FSPC=//depot/projects/usb/src/sys/ > >> >dev/usb/input/ukbd.c&REV=47 > >> > >> Not quite true, my keyboard _does_ have an Eject key. The code doesn't > >> detect it though. > >> > >> - Steven > >> > > > > Could you try to figure out what key-press number corresponds to the eject > > key? > > > > --HPS > > > > I'm not certain how to do so. It's somewhat of a chicken-and-the-egg > problem: unless it detects that the key is there, I can't find it. > Enabling 'hw.usb.ukbd.debug' doesn't print anything when Eject is > pressed. It's very possible that your Eject key is in a separate interface and is handled by uhid(4) instead of ukbd(4). /Kai