[Bug 282411] ukbd: apple_swap not enabled on Apple ISO keyboard

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 29 Oct 2024 21:07:02 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282411

            Bug ID: 282411
           Summary: ukbd: apple_swap not enabled on Apple ISO keyboard
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: usb
          Assignee: usb@FreeBSD.org
          Reporter: frank.hilgendorf@posteo.de

On my MacBookPro 3,1 with internal ISO keyboard, apple_swap is not enabled
although it is required.

sysadmin@hilschubookBSD:~ $ sudo usbconfig -d ugen5.3 dump_device_desc
ugen5.3: <Apple Computer Apple Internal Keyboard / Trackpad> at usbus5, cfg=0
md=HOST spd=FULL (12Mbps) pwr=ON (40mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0008 
  idVendor = 0x05ac 
  idProduct = 0x021b 
  bcdDevice = 0x0018 
  iManufacturer = 0x0001  <Apple Computer>
  iProduct = 0x0002  <Apple Internal Keyboard / Trackpad>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001 

In ukbd.c, currently apple_swap is enabled when the Eject key is found in the
usage page. 
IMO it would be better to enable apple_swap on all ISO keyboards.
In this post 

https://stackoverflow.com/questions/3202629/where-can-i-find-a-list-of-mac-virtual-key-codes

the situation is explained, referring to 'Apple toolbox essentials' 

https://developer.apple.com/library/archive/documentation/mac/pdf/MacintoshToolboxEssentials.pdf

There, the key swap between ANSI and ISO layouts is depicted on page 2-43.

I have prepared a patch in Pull Request

https://github.com/freebsd/freebsd-src/pull/1487

-- 
You are receiving this mail because:
You are the assignee for the bug.