LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 02-17-2005, 03:46 PM   #1
Ayukawa
LQ Newbie
 
Registered: Apr 2003
Location: Richmond, VA
Distribution: Slackware 10.1
Posts: 11

Rep: Reputation: 0
Onetouch buttons with ze4900?


I'm looking to get the one-touch buttons (and more importantly, the volume buttons) to work under linux on a HP Pavilion ze4900. However, while the omnibook module is loading, and cat /proc/omnibook/onetouch is telling me that the buttons are enabled, I am unable to set shortcuts in KDE.
 
Old 03-11-2005, 10:08 AM   #2
quotidian
LQ Newbie
 
Registered: Oct 2003
Posts: 2

Rep: Reputation: 0
Re: Onetouch buttons with ze4900?

Quote:
Originally posted by Ayukawa
I'm looking to get the one-touch buttons (and more importantly, the volume buttons) to work under linux on a HP Pavilion ze4900. However, while the omnibook module is loading, and cat /proc/omnibook/onetouch is telling me that the buttons are enabled, I am unable to set shortcuts in KDE.
I managed to get one-touch buttons working on my ze4900. Here's a mini-HOWTO:

The ze4900's multimedia keys require a new kernel module, a program for configuring the keys, and additional configuration at the command line (not in that order). The module you require is the Omnibook kernel module available at http://www.sourceforge.net/projects/omke. This module builds without a hitch against kernel 2.6.9.

You also need xhkeys, a tool for configuring hotkeys under X: http://freshmeat.net/projects/xhkeys/

here's what you have to do in order to get your fancy blue-lit keys working:

1. Compile and install the Omnibook kernel module according to directions. You'll need kernel source for this.

2. The kernel module recognizes several different protocols - you need protocol 7 (see the README). Insert the module like so:

modprobe omnibook ectype=7

3. Compile and install xhkeys according to directions. We'll get back to xhkeys in a moment.

4. With the Omnibook kernel module inserted, all of your multimedia keys will be recognized, though not useful at first. (Without the Omnibook module, only three or four of your one-touch keys will be recognized.) Now you have to associate the keys' scancodes with keycodes. Now wait, don't panic - this isn't that hard.

Each time you press a key, it emits a hexidecimal "scan code" which must be mapped to a "key code" stored in a table. The scan code indicates what button has been pressed; the key code indicates what that button should do. Before you inserted the driver, your one-touch keys weren't recognized; with the driver, the keys emit scan codes but aren't mapped to key codes.

You only really need three commands: setkeycodes, getkeycodes, and showkey. showkey -s will tell you what scan code a given key is associated with. getkeycodes will show you the scancode-to-keycode table, and setkeycodes will allow you to associate a scancode with a keycode. For more information on this, read the manual entry for setkeycodes.

5. Open a console and type tail -f /var/log/syslog. Press each of your multimedia buttons and watch the console - Linux will complain that it doesn't know what to do with them, and in the process give you the scancode you need. Write them down. If syslog doesn't complain about a given keypress, then there's already a keycode associated with that key (for me, this was the case with my volume keys and my web browser keys).

6. Once you have all the scancodes you need, type getkeycodes and take a look at the table that results. The left column consists of hexadecimal scancodes, while the remaining columns consist of decimal keycodes. This might be a little confusing, but it doesn't matter what keycode you choose so long as it's not already taken (e.g., if you choose a keycode for your mute button already used by the letter B, then B will no longer do what it's supposed to do). Don't worry about screwing up - rebooting the machine will reset the keycodes to their default. Go through the keycode table and pick out numbers not already in use - you'll need one for each new key.

7. Once you have all the numbers you need, scancode and keycode alike, use setkeycodes to associate the one-touch scancodes to your fresh new keycodes:

setkeycodes scancode keycode

For reference, here are my settings:

# mail key
setkeycodes e01e 120

# display key
setkeycodes e008 122

#lock key
setkeycodes e00a 123

# help key
setkeycodes e031 129

8. At a console, type xhkconf. xhkconf will ask you to press a key you'd like to mess with, and afterwards lead you through a configuration process. When you're done, type xhkeys and try one of the newly assigned keys to see if it works.

For reference, here are some commands you might find useful:

To raise volume (under ALSA): amixer -q -c0 sset Master,0 2%+,2%+
To lower volume (under ALSA): amixer -q -c0 sset Master,0 2%-,2%-
To mute/unmute volume: amixer sset Master toggle
To lock display (under X): xscreensaver-command -lock
To lock display (under KDE): dcop kdesktop KScreensaverIface lock

9. Once you're sure everything works, add modprobe omnibook ectype=7 as well as your setkeycodes commands to rc.local. Make sure your preferred desktop environment starts xhkeys, and you're all set.
 
Old 08-17-2005, 08:42 AM   #3
salas
LQ Newbie
 
Registered: Aug 2005
Posts: 1

Rep: Reputation: 0
dont work with kernel 2.6.8

I'm using Ubuntu Warty with a kernel 2.6.8.1 on a HP Pavilion ze4900 series and this is the output when I try to load the module:

root@MIMAQUINA:/root/omnibook-2005-02-17 # make load
# Removing module from old location
rm -f /lib/modules/misc/omnibook.*o
mkdir -p /lib/modules/2.6.8.1-3-386/kernel/drivers/char/omnibook
install -m 644 omnibook.ko /lib/modules/2.6.8.1-3-386/kernel/drivers/char/omnibook
depmod -a
modprobe omnibook
FATAL: Error inserting omnibook (/lib/modules/2.6.8.1-3-386/kernel/drivers/char/omnibook/omnibook.ko): Invalid module format
make: *** [load] Error 1


Any suggestion?
Thanks.
 
Old 09-06-2005, 06:25 PM   #4
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Rep: Reputation: 15
You need to execute modprobe yourself instead of make load, since you need to load the module with a parameter.

#modprobe omnibook ectype=7

Hope that works better for you.
 
Old 09-07-2005, 03:55 PM   #5
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
I had a similar situation on my ze4315 running Slackware 10.1. Last week I finally decided to make my buttons work. I used xev to get the keycodes for each button (some don't respond so don't produce a code so can't use). Then edit your ~/.xmodmap file to map these keycodes to names that you can apply as hotkeys. KDE supports the XF86 keysyms such as XF86RaiseVolume and XF86Lower Volume.
 
Old 09-07-2005, 07:20 PM   #6
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Rep: Reputation: 15
Don't be so quick to despair, dracolich.

The first thing you need to do is determine if the kernel is getting any scancodes from those buttons (see insturctions above). If that's not even happening, you might need the omnibook module.

Then you just need to assign keycodes to the scancodes. The problem I'm having with this right now is that the keycodes I assign with setkeycodes are not the keycodes that X receives. It's a little bizarre. Only one key actually does generate the right keycode.

If anyone has thoughts on what could cause that, I'm all ears.

Edit: You can look through /etc/X11/xkb/symbols/inet and /etc/X11/xkb/keycodes/xfree86 for ideas on what keycodes to use.

Last edited by Itzac; 09-07-2005 at 07:22 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Maxtor OneTouch USB external drive button support nicflatterie Linux - Hardware 3 12-01-2005 11:21 PM
Visioneer Onetouch 9000 scanner support jryoung Linux - Hardware 0 10-27-2004 02:34 AM
OneTouch 300GB HDD mankool Linux - Hardware 1 08-01-2004 09:11 AM
Mandrake 10.0 and Visioneer OneTouch 7600 USB Problem marsh58 Linux - Hardware 1 04-14-2004 04:05 PM
Using buttons 4 and 5 kleptophobiac Linux - Hardware 5 08-02-2003 01:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 04:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration