This project was inspired by David Levitan's
sonyfxd project.
Ideas used in sonykeyd are taken from
sonypid
(event reading) and
acpid
(handling events by user configurable shell script).
As this project didn't evaluate nearly at all since its initial version (0.01 in Apr 2002), you may prefer to use something that is developed more actively, eg.
Compile recent 2.4 (2.4.7+) or 2.6 kernel. You must compile in sonypi driver.
This description assumes that sonypi is compiled as an module, but you can
configure it as solid part of the kernel as well.
You will find relevant kernel option in
(Device Drivers ->) Character devices -> Sony Vaio Programmable I/O Control Device support
If your model doesn't have Jogdial button, you may need use newer kernel (2.4.19+) version as it has necessary changes.
alias char-major-10-63 sonypi options sonypi minor=63 nojogdial=1Of course if your model has Jogdial, clear "nojogdial=1" option!
# mknod /dev/sonypi c 10 63If your system (eg. Fedora Core 3) uses udev, please see docs, to find out how to make this device node permanent.
$ tar -xzf sonykeyd-0.2.tar.gzCompile it:
$ cd sonykeyd-0.2 $ makeYou may have to modify Makefile and change /usr/src/linux/include path to wherever your kernel headers are.
# make installwill simply copy sonykeyd file to /usr/local/sbin. You can do it by hand.
By default, when sonypi event is registered,
/usr/local/sbin/sonykey.sh program (script) is called.
Names of keys used are in the table (or in strings.c file in package)
Bash script sonykey.sh included in package will do the following:
Fn+F3: mute/unmute
Fn+F4: select global/pcm volume for changing
Fn+F5: select brightness for changing
Fn+1: decrease selected option
Fn+2: increase selected option
Fn+E: eject the cdrom
This script calls
aumix program to control volume,
spicctrl
program to control brightness, and eject program to eject cdrom tray.
Feel free to extend or replace what the script do...
# cp scripts/sonykey.sh /usr/local/sbin # chmod 0700 /usr/local/sbin/sonykey.sh
# mkdir -p /var/local/sound/state
# ./sonykeyd
Try it!
Press Fn+F5, and Fn+1 several times... Does the screen get darker?
Now play some music and press Fn+F4 and Fn+1. Any volume change?
What about Fn+E -- eject?
Sorry, this was tested on RedHat & Fedora Core 2 only. But should work on any system that uses config utility.
copy sonypi to /etc/rc.d/init.d and make it executable:
# cp scripts/sonypi /etc/rc.d/init.d # chmod 0755 /etc/rc.d/init.d/sonypiInstall it.
# chkconfig --add sonypi
event | sonykeyd name | FX240 |
---|---|---|
Unknown event | unknown | |
Jogdial Down | jd-down | |
Jogdial Up | jd-up | |
Jogdial Down & Pressed | jd-down-P | |
Jogdial Up & Pressed | jd-up-P | |
Jogdial Pressed | jd-P | |
Jogdial Released | jd-R | |
Capture Pressed | cp-P | |
Capture Released | cp-R | |
Capture Partial Pressed | cp-partP | |
Capture Partial Released | cp-partR | |
Fn-Esc Pressed | fn-esc | works |
Fn-F1 Pressed | fn-f1 | works |
Fn-F2 Pressed | fn-f2 | works |
Fn-F3 Pressed | fn-f3 | works |
Fn-F4 Pressed | fn-f4 | works |
Fn-F5 Pressed | fn-f5 | works |
Fn-F6 Pressed | fn-f6 | works |
Fn-F7 Pressed | fn-f7 | works |
Fn-F8 Pressed | fn-f8 | works |
Fn-F9 Pressed | fn-f9 | works |
Fn-F10 Pressed | fn-f10 | works |
Fn-F11 Pressed | fn-f11 | works |
Fn-F12 Pressed | fn-f12 | works |
Fn-1 Pressed | fn-1 | works |
Fn-2 Pressed | fn-2 | works |
Fn-D Pressed | fn-d | works |
Fn-E Pressed | fn-e | works |
Fn-F Pressed | fn-f | works |
Fn-S Pressed | fn-s | works |
Fn-B Pressed | fn-b | |
Bluetooth Button Pressed | p-bt | |
P1 Pressed | p-p1 | works |
P2 Pressed | p-p2 | works |
P3 Pressed | p-p3 | works |