WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Sony Vaio Function Key  (Read 4246 times)

Offline aplannan

  • Jr. Member
  • **
  • Posts: 70
Sony Vaio Function Key
« on: June 13, 2011, 10:47:09 AM »
Hi,

I was forced over he weekend to switch to a new laptop due to a faulty power jack on my thinkpad x31. Now using an inherited Sony Vaio vgn-s360. Have everything pretty much up and running well except the Fn key which would allow me to change the volume, screen brightness etc. Is there an extention with the correct drivers, or has anyone come up with a solution?

Thanks in advance for any help,

Andy

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Sony Vaio Function Key
« Reply #1 on: June 13, 2011, 12:27:05 PM »
Does a google search turn up something?

If you load the acpi extension and start it manually with logging enabled, you can press each key in turn to see if it is recognised - if so, then maybe somebody already wrote a script to act on the key press or, if not, you could write one yourself.

I seem to recall a thread in these forums about writing acpi action scripts.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Sony Vaio Function Key
« Reply #2 on: June 13, 2011, 12:47:05 PM »
On many laptops the fn key is driverless, with it and the other key pressed the keycode changes, all transparent to the OS. You can test this with xev, if it is so, you just need to bind actions to those keys (use a WM that can, or a separate daemon like actkbd).
The only barriers that can stop you are the ones you create yourself.

Offline aplannan

  • Jr. Member
  • **
  • Posts: 70
Re: Sony Vaio Function Key
« Reply #3 on: June 13, 2011, 09:05:50 PM »
Thanks for the help. xev isn't showing anything when I press the Fn key. Juanito could you give me a few more details about how to use acpi with manual logging enabled. I have been googling. It seems there is a kernal module called sony-laptop that I believe handles this kind of thing. If I type modprobe -l|grep sony I can see it. I don't know if I need to enable this or not or if it is all I need, as I've never had hardware issues in the past with the IBM

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Sony Vaio Function Key
« Reply #4 on: June 13, 2011, 11:49:10 PM »
In fact it looks like a log is written to /var/log/acpid by default, but "sudo acpid --logfile /var/log/acpid" would achieve the same thing.

see also: http://www.linux.it/~malattia/wiki/index.php/Sony-laptop#Fn_keys_.28hotkeys.29

..it looks like things should "just work" with Xorg  :P

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Sony Vaio Function Key
« Reply #5 on: June 14, 2011, 01:43:28 AM »
I meant a combo, ie fn-f1 or whatever is the right key. Fn itself should not register.
The only barriers that can stop you are the ones you create yourself.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Sony Vaio Function Key
« Reply #6 on: June 16, 2011, 04:57:52 AM »
I noticed a dell_wmi kernel module gets loaded automatically for my laptop, which I presume is similar to your sony-laptop module.

On my machine at least, acpid only seems to recognise some power events, eg:
Code: [Select]
$ sudo acpid -fdl
proc fs opened successfully
acpid: starting up with proc fs
acpid: 0 rules loaded
acpid: waiting for events: event logging is on
acpid: procfs received event "ac_adapter AC 00000080 00000000"
acpid: 0 total rules matched
acpid: procfs completed event "ac_adapter AC 00000080 00000000"
acpid: procfs received event "battery BAT0 00000080 00000001"
acpid: 0 total rules matched

..but xev and Xorg-7.5 seems more promising, pressing the <fn> and <volume-up> keys together:
Code: [Select]
$ xev

KeyPress event, serial 27, synthetic NO, window 0xc00001,
    root 0x11d, subw 0x0, time 817191, (179,-1), root:(197,617),
    state 0x0, keycode 176 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

However I have found that it is often not obvious to get applications to respond to some of these sort of inputs.