LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Fn button (https://www.linuxquestions.org/questions/slackware-14/fn-button-637813/)

diver 04-25-2008 12:32 PM

Fn button
 
Hi.
A use laptop Acer 5620
Slackware 12 -current

Anyone have idea how to get to work Fn button on laptop?
I mean Fn+brightness and Fn+sound volume...

gmartin 04-25-2008 12:47 PM

Take a look at this blog post (Google is your friend). It is talking about a Dell, but offers a generic solution. It's near the bottom

http://intr.overt.org/blog/?page_id=56

diver 04-25-2008 01:27 PM

Hi, gmartin

Thanks for help and for a new friend "Google".
I didn't know what to look for, not been lazy one ...

So i get :

you will need to use setkeycodes to do that.

usage: setkeycode scancode keycode ...
(where scancode is either xx or e0xx, given in hexadecimal,
and keycode is given in decimal)

* Fn -Down (e005) - Automatically decreases brightness and generates a key event.
* Fn -Up (e006) - Automatically increases brightness and generates a key event.

How i run it?

setkeycode e005 ???

gmartin 04-25-2008 01:40 PM

Quote:

Originally Posted by diver (Post 3132850)
Hi, gmartin

So i get :

you will need to use setkeycodes to do that.

usage: setkeycode scancode keycode ...
(where scancode is either xx or e0xx, given in hexadecimal,
and keycode is given in decimal)

* Fn -Down (e005) - Automatically decreases brightness and generates a key event.
* Fn -Up (e006) - Automatically increases brightness and generates a key event.

How i run it?

setkeycode e005 ???

Perhaps after you have it working from the command-line you could add it to /etc/rc.d/rc.local. That script get's executed at bootup

diver 04-25-2008 02:28 PM

Still i don't get how to run it.
I used xev to find keycode

fn+IncBright keycode is 212
Fn-DecBright keycode is 101

so i run

setkeycodes e030 212
setkeycodes e02e 101

Nothing happens. The keys not functioning.
Am i missing something?

duryodhan 04-25-2008 09:46 PM

What I do for the multimedia keys ...

find out the keycodes of the buttons ...and then edit my ~/.Xmodmap
(create if not present)

my ~/.Xmodmap is :
Quote:

keycode 174 = F20
keycode 176 = F21
keycode 160 = F22
keycode 144 = F23
keycode 160 = F24
keycode 153 = F25
keycode 162 = F26
Then in my KDE autostart , I have put
Quote:

$cat ~/.kde/Autostart/start.sh
#! /bin/bash
xmodmap ~/.Xmodmap
Now KDE can detect my multimedia keys. After that, I have to set the various shortcuts at different places ... I don't know where to set the change brightness shortcut in KDE sorry

LordAnta 04-26-2008 08:49 AM

On 3 different laptops (Asus, Benq, Acer) with different linux distros (Slackware, Debian, OpenSuse) i saw that you don't need to set the keycodes for Fn+BrightenessUP or Down. It's a call directly to the BIOS, it doesn't involve the kernel (for example try incresing and decreasing the brightness when you are at lilo or when it's booting, and you will se that the brightness changes). It doesn't show that progress bar like in Windows, but it does his job. Same thing is with Fn and the Displays (the button with LCD/CRT image or something like that - the trick is to install the video drivers with dual-head).

For the multimedia keys, it's a bit different story.

cathectic 04-26-2008 11:49 AM

Quote:

Originally Posted by diver (Post 3132808)
A use laptop Acer 5620

Too vague - which series? Aspire, Extensa, TravelMate (or even Ferrari)?

Quote:

Originally Posted by lordanta
On 3 different laptops (Asus, Benq, Acer) with different linux distros (Slackware, Debian, OpenSuse) i saw that you don't need to set the keycodes for Fn+BrightenessUP or Down. It's a call directly to the BIOS, it doesn't involve the kernel

Depends on the Acer laptop. Yes, on older ones, this is the case (i.e. anything pre-2005 is guaranteed to just work). Post 2005 is a bit more hit-and-miss.

Quote:

Originally Posted by lordanta
Same thing is with Fn and the Displays

AFAIK, this hasn't been true on Acer laptops for at least four years now.

Quote:

Originally Posted by diver (Post 3132808)
Anyone have idea how to get to work Fn button on laptop? I mean Fn+brightness and Fn+sound volume...

Sound is a matter of using the right X keymapping (evdev should work here, see further down).

From what you're saying, you probably have one of the newer Acer laptops that doesn't just work out-of-the-box for this, so you'll need either acer_acpi (an out-of-tree module, if using a pre 2.6.25 kernel) or acer-wmi (an in-tree driver as of 2.6.25) to tell the kernel how to control the backlight.

The next step for the backlight keys is to then get the scancodes mapped properly to the right keycodes (then I believe the kernel handles toggling the brightness). HAL takes care of this for many laptops already (and I've been adding the Acer ones like mad as I come across them). Chances are though, in 12.1 (whenever that comes out), this step will just be done for you. 12.0 might be a bit more hit-and-miss. Try the Fn+{Left, Right} keys and see if they produce any scancode messages in dmesg to tell if they're already mapped or not.

After that, the easiest way (and what I use) to get the keys working in X properly is to use evdev as your keyboard driver - once your keys are mapped properly, evdev does the necessary kernel-to-X translation and things just work (and yes, I really do use this on my own Acer).

LordAnta 04-26-2008 12:09 PM

@cathetic:
My Benq JoyBook A52 it's made in november 2007. The Acer I was talking about is bought in november 2007 (with a intel Core2Dou at 2Ghz and a NVidia 8600GT 512Mb, i don't think it is that old :D). The Fn + Display I only tested on my Asus and Beng at presentations, but the first thing after easter I will try it on my roomates Acer cause you made me curios.

roshaph 04-26-2008 01:00 PM

Quote:

Originally Posted by LordAnta (Post 3133598)
On 3 different laptops (Asus, Benq, Acer) with different linux distros (Slackware, Debian, OpenSuse) i saw that you don't need to set the keycodes for Fn+BrightenessUP or Down. It's a call directly to the BIOS, it doesn't involve the kernel (for example try incresing and decreasing the brightness when you are at lilo or when it's booting, and you will se that the brightness changes). It doesn't show that progress bar like in Windows, but it does his job. Same thing is with Fn and the Displays (the button with LCD/CRT image or something like that - the trick is to install the video drivers with dual-head).

For the multimedia keys, it's a bit different story.

Totally agree with you, just don't get what you mean by "to install the video drivers with dual-head"? Because I have problems throwing pictures to the beamer, when its connected to my laptop.

LordAnta 04-26-2008 02:18 PM

On my Benq laptop I have an Ati Radeon Express 200M with 128Mb shared from RAM (don't throw rocks at me, i know about ati based video card and linux, but Compiz still works like a charm :D). After the driver installation, i have to run:

Code:

./aticonfig --initial=dual-head
This writes in xorg.conf that i have 2 monitors (the laptops LCD and an external screen -- video projector, monitor, whatever) which can be used in the same time.

grissiom 04-27-2008 09:33 AM

Quote:

Originally Posted by duryodhan (Post 3133181)
What I do for the multimedia keys ...

find out the keycodes of the buttons ...and then edit my ~/.Xmodmap
(create if not present)

my ~/.Xmodmap is :

keycode 174 = F20
keycode 176 = F21
keycode 160 = F22
keycode 144 = F23
keycode 160 = F24
keycode 153 = F25
keycode 162 = F26

Then in my KDE autostart , I have put


Now KDE can detect my multimedia keys. After that, I have to set the various shortcuts at different places ... I don't know where to set the change brightness shortcut in KDE sorry

OK, I know what "174","176","160", mean, but what do "F20", "F21", "F22" mean?

diver 04-27-2008 02:03 PM

Quote:

Originally Posted by cathectic (Post 3133717)
Too vague - which series? Aspire, Extensa, TravelMate (or even Ferrari)?

Depends on the Acer laptop. Yes, on older ones, this is the case (i.e. anything pre-2005 is guaranteed to just work). Post 2005 is a bit more hit-and-miss.

AFAIK, this hasn't been true on Acer laptops for at least four years now.

Sound is a matter of using the right X keymapping (evdev should work here, see further down).

From what you're saying, you probably have one of the newer Acer laptops that doesn't just work out-of-the-box for this, so you'll need either acer_acpi (an out-of-tree module, if using a pre 2.6.25 kernel) or acer-wmi (an in-tree driver as of 2.6.25) to tell the kernel how to control the backlight.

The next step for the backlight keys is to then get the scancodes mapped properly to the right keycodes (then I believe the kernel handles toggling the brightness). HAL takes care of this for many laptops already (and I've been adding the Acer ones like mad as I come across them). Chances are though, in 12.1 (whenever that comes out), this step will just be done for you. 12.0 might be a bit more hit-and-miss. Try the Fn+{Left, Right} keys and see if they produce any scancode messages in dmesg to tell if they're already mapped or not.

After that, the easiest way (and what I use) to get the keys working in X properly is to use evdev as your keyboard driver - once your keys are mapped properly, evdev does the necessary kernel-to-X translation and things just work (and yes, I really do use this on my own Acer).

Hi.
Thanks for help.
I use acer Extensa 5620Z.
Slackware -current
kernel 2.6.24.5 generic-smp

If i get your point, i need first acer-wmi driver to tell the kernel how to control the backlight.
How i install it?

Than, get the scancodes mapped properly to the right keycodes...

Than, to use evdev as my keyboard driver ...

Not sure, i am at this level of understanding, but i will try ...

Now i try to google for :
acer-wmi download slackware

diver 04-27-2008 02:16 PM

OK. Here we go ...

I found this module and installed it.

cat /proc/modules | grep acer
acer_acpi 19264 0 - Live 0xf8acd000
led_class 7300 1 acer_acpi, Live 0xf8aaa000
wmi_acer 10668 1 acer_acpi, Live 0xf8a3d000


I hope i do ok ???

T3slider 04-27-2008 03:53 PM

I don't know where you got the module, but the correct place, as far as I can tell, is here: http://code.google.com/p/aceracpi

It even has a SlackBuild so you can build a package. (Beyond that you're on your own unless someone else, like cathectic, can help out.)


All times are GMT -5. The time now is 04:12 PM.