Would require something similar to addon-acpi-buttons-toshiba, but reading from /dev/sonypi instead. The main problem being that each laptop has the keys places in a different position, ie. SONYPI_EVENT_FNKEY_F5 corresponds to "lower brightness" on my laptop, but might be something else on another one.
Created attachment 5467 [details] [review] hal-sonypi-addon-1.patch First pass. How do I change the keys generated depending on the prefix of smbios.system.product? For example, this S1XP has: smbios.system.product = 'VGN-S1XP(GB)' (string) and I'd like all "VGN-S1XP" devices to have those keys generated.
By the way, this is untested, and the build was made in the hal-0.5.7 CVS branch.
Seems a sane way of doing this IMO, but wouldn't it be a better way of doing this to just lauch the addon and do the keymapping in fdi files? There's an exaple of that for the tosiba addon in the archives.
For matching, you can use "contains" (like strstr) and "contains_ncase" (similar but ignores case) as we do here http://webcvs.freedesktop.org/*checkout*/hal/hal/fdi/information/10freedesktop/10-usb-zip- drives.fdi?rev=1.1
I also agree it would be good having the keymapping in fdi files so mere mortal users can do the remapping themselves. So you would have x-sonypi.keymapping.<keycode> = "brightness" and your add-on would read this...
This page has the details for one special case Vaio: https://launchpad.net/distros/ubuntu/+source/hotkey-setup/+bug/22489 sonypi includes an input device (which I wasn't told about despite having sent a patch for it) for the keys, so we just need to convert the keys. <mjg59> hadess: As far as I can tell, pretty much all Sonys except the really tiny ultraportables use the same layout hotkey includes details: ftp://ftp.debian.org/debian/pool/main/h/hotkey-setup/
David, how about merging the initial patch, and then when a user complains (if ever) that the button mapping is incorrect, we *interrogate* them and then add the fdi mapping thing as reqd.
Actually, we decided on IRC that it would be better to have the sonypi driver send out the right keycodes, rather than hack it in HAL. I'll leave this open until the sonypi driver changes are made.
Richard fixed this on my VAIO, by fixing the sony-laptop driver to emit key events with MSC_SCAN, so that the keycodes can be changed per-laptop.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.