# Mapping Custom Keys on Laptop



## pkc (Aug 23, 2012)

Hi, I would imagine that this has been gone over at some point but I haven't found any material on it, possibly because I'm not familiar with the appropriate terminology.

I have one of those upscale laptops, a Vaio, that has all those random buttons above the keyboard that are supposed to perform various functions on a compatible system (i.e., Windows), such as pause/play of music playback, opening a browser, etc. I would like to somehow discover how to capture these keys, and perhaps send them either to my KDE system or at least to some executable that I can write.

Is this a process of editing a keyboard driver, or just instructing an existing driver to listen for different keys and map them accordingly? I am fairly clueless when it comes to how the keyboard interacts with the system, so any help is appreciated.


----------



## cpm@ (Aug 23, 2012)

You should also load acpi_sony.ko module:
[CMD=]$ kldload acpi_sony[/CMD]

To make it permanent add acpi_sony_load="YES" to /boot/loader.conf.

For more info read the manual page for acpi_sony(4).


----------



## pkc (Aug 23, 2012)

Thanks for the reply, I didn't realize acpi_sony existed. However, is it possible to capture the 'values' of these keys at the top, the sound control, 'web' keys, etc? They are unlikely to be mapped by any implementation of a keyboard driver/interpreter (again, not sure how it exists down there), given that most laptops do not have these keys, but certainly the values are captureable somehow and thus it is possible to configure the system to map them?


----------



## pkc (Aug 23, 2012)

Also, interestingly, the system only seems to be recognizing Fn when it is in combination with F8, although it comes up as '9~' in Konsole. Is there a way to test the keyboard mappings? Since presumably there could be a misconfiguration somewhere in KDE or something that is causing the key event to be discarded.


----------



## cpm@ (Aug 23, 2012)

Yes, running xev, reports keypress events when the buttons are pressed. But you would check xmodmap(1), for editing and displaying the keyboard modifier map and keymap table in X.


----------

