LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-20-2005, 12:41 PM   #1
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
getting "extra keys" to work on a keyboard


So my old keyboard was dying on me and it was time to find a heir. I wanted to get a silent keyboard so i wouldn't wake up anyone with the mad clattering of my midnight working sprees. I got this snazzy keyboard with LED's under the keys. It also comes with a "Command Pad" which has 9 keys and two modes, so technically you should be able to add 18 hotkeys (maybe the mode buttons work like shift keys, so you would be able to get 36 hotkeys). The keyboard also has 3 volumne buttons for more volumne, less volumne and a mute toggle. Is there a way to get this buttons working? Like an app that will read input from the keyboard so you can set the keys to do things? Like maybe open thunderbird in desktop 4, or mount/umount some nfs drives? Thanks.

BTW it's a usb keyboard (don't really thing this matters at all).
 
Old 02-20-2005, 01:09 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Take a look at xbindkeys:
http://hocwp.free.fr/xbindkeys/xbindkeys.html
 
Old 02-20-2005, 01:31 PM   #3
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by david_ross
Take a look at xbindkeys:
http://hocwp.free.fr/xbindkeys/xbindkeys.html
Works great except for the "command pad". That's funny. The command pad is an external pad connected via "ethernet cable" to the keyboard. It is connected because it lights up with LED's, but i can't get any input from it. What could be the problem?

EDIT: BTW, you know the code for raising the mixer volumne on master, lowering it and toggling mute? Thanks.

Last edited by bobbens; 02-20-2005 at 01:44 PM.
 
Old 02-20-2005, 01:47 PM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
One can find the keycodes for each key by running ' xev '.

Now don't know which gui you are running but in KDE if you have the program open like thunderbird (move it to the virtual window you want it in). Right click on the title bar > select Advanced > Special Window Settings. Once here Go to the Geometry tab, check the Desktop box, Change default DO Not Affect to Remember, then select which Desktop you want to it to start in.

Back to keycodes.
Also Like above xbindkeys does a great job. Problably be the best option.

Antoher way If using KDE then in control panel goto khotkeys and add them that way. Also check out a post I did a few years back. I don't do it that way anymore. I do it the khotkeys way control center.
http://www.linuxquestions.org/questi...388#post536388

In Control Center > Reginoal & Accessibilty > Khotkeys
1. I would create a new group first. Then in this new group add New Action.
2. Change Action Type to Keyboard ShortCut/Command URL.
3. Create a new Action Name for the key also.
4. Next tab called Keyboard Shortcut. hit the Key to record.
5. Next tab Command/URL Settings. Point it to the program to start.


Brian1
" Google the Linux way @ http://www.google.com/linux "
 
Old 02-20-2005, 02:10 PM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
For volume I did the following using F10 for mute. F11 for lower volume, F12 to raise volume. Ended up creating 5 scripts. One to raise volume. One to lower volume. And three that does the mute. Follow some info from the link in my above post.

But I will post the contents of each script I am using now.
/opt/volumekeys/volumeup
Code:
#!/bin/sh
aumix -v +5 -S
/opt/volumekeys/volumedn
Code:
#!/bin/sh
aumix -v -5 -S
edit: Updated mute scripts to save volume settings before muting then restoring to previous volume level when unmuting.

Contents of /opt/volumekeys/volumemute2
Code:
#!/bin/sh
# copy of volumemute2
aumix -S
aumix -v0
cp /opt/volumekeys/volumemute1 /opt/volumekeys/volumemute
Contents of /opt/volumekeys/volumemute1
Code:
#!/bin/sh
# copy of volumemute1
aumix -L
cp /opt/volumekeys/volumemute2 /opt/volumekeys/volumemute
Contents of /opt/volumekeys/volumemute
Code:
#!/bin/sh
# copy of volumemute2
aumix -S
aumix -v0
cp /opt/volumekeys/volumemute1 /opt/volumekeys/volumemute
I would copy over volumemute2 contents to volumemute script for the first time. I also add the command ' cp /opt/volumekeys/volumemute2 /opt/volumekeys/volumemute ' to /etc/rc.local file so it is set to go from a reboot. Using the command aumix -L is problably overkill since the ~/.aumixrc should not change from point A to point B but helps to make since of it all.

edit:

Now if using KDE I used the khotkeys in the Control Panel to map the keys to the action like in the above post. Also one might want to run the script /opt/volumemute1 at start to make sure the mute key is set correctly to mute the first time it is pressed. This can be added to /etc/rc.local file.
Example of my rc.local on my notebook.
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

# Install misc modules
echo "Loading modules pcspkr, bttv, ohci1394, ieee1394, raw1394, sbp2, snd-intel8x0m,..."
modprobe pcspkr
modprobe bttv
modprobe ohci1394
modprobe ieee1394
modprobe raw1394
modprobe sbp2
modprobe snd-intel8x0m

# Lid buuton
echo "Setting up default Lid Button..." 
cp /etc/acpi/actions/lidbtnoff.sh /etc/acpi/actions/lidbtn.sh

# Mute Script setup 
/opt/volumekeys/volumemute1

# 3 sec pause
ping -c10 127.0.0.1 > /dev/null

touch /var/lock/subsys/local
Hope this helps.
Brian1
" Google the Linux way @ http://www.google.com/linux "

Last edited by Brian1; 06-23-2005 at 05:43 PM.
 
Old 02-20-2005, 02:18 PM   #6
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Also a simply way to turn volume up and down is if you know the keycode to the key you wish to use for each then you can add the following to Xmodmap. This is not Gui Specific.
etc/X11/Xmodmap
Code:
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
These values are what I get when I press the volume buttons on my notebook. I also do it this way. I don't have a mute button but one can do this.
Code:
keycode 180 = XF86AudioRaiseMute
There is more than one way to do just about anything under linux.

Brian1
" Google the Linux way @ http://www.google.com/linux "
 
Old 02-20-2005, 02:35 PM   #7
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Brian1
Also a simply way to turn volume up and down is if you know the keycode to the key you wish to use for each then you can add the following to Xmodmap. This is not Gui Specific.
etc/X11/Xmodmap
If this Xmodmap doesn't exist should i create one? How do i get it running without rebooting? Or do i have to restart X? Thanks. It looks like the easiest way out. BTW you have any idea for getting the "command pad" working? It doesn't seem to give any output with xev, xbindkeys, or whatever. Thanks again.
 
Old 02-20-2005, 03:16 PM   #8
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Sounds like the pad is driver specific. Contact the manufactor and see if they have a linux module or driver for it. If xev can't see it then I am not much help. Not knowing your system, you can create the Xmodmap file, just a plain text file. You might search your drive and see if Xmodmap is somewhere else. Not ever distro puts files in the same place. Also one can create it in your own home directory and name it ' .xmodmap '. Hope this helps. Not sure but I believe it will require X to be restarted. It can be done without restarting but I would have to figure it out. Problalby have to restart the dcopserver.

Brian1
" Google the Linux way @ http://www.google.com/linux "
 
Old 02-21-2005, 12:37 PM   #9
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Hi,

The command pad is a HID-compliant device and should make all the same
'calls' that a USB joystick does.

Best Regards
Richard Neville
Tech Support
Saitek UK
Ok, so how would i get about to emulating a joystick at the usb slot my keyboard is? I've checked and i only see /dev/input/js0, /dev/input/js1 and /dev/input/js2, which are my gamepads, but i don't see js3, of course i don't have discover installed. Anyone know how i can get around to getting this pad to work? Thanks.
 
Old 02-21-2005, 04:29 PM   #10
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Go under your current modules for /lib/modules/kernel_version_running_number/kernel/drivers/usb/input. Try modprobe wacom and see if it loads. Try some of the others and see what happens. Might also need to modprobe evdev if some of the others load. Also I believe you will need to modify the xorg.conf.

Check out this link for starters. http://linuxwacom.sourceforge.net/index.php/howto/all This may not be right but may give you a starting point.

Brian1
" Google the Linux way @ http://www.google.com/linux "
 
Old 02-22-2005, 07:29 AM   #11
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Brian1
Check out this link for starters. http://linuxwacom.sourceforge.net/index.php/howto/all This may not be right but may give you a starting point.

Brian1
" Google the Linux way @ http://www.google.com/linux "
??? this would be to try to get some joystick input from my keyboard, that would technically allow it's "command pad" to work. I have a wacom installed, though i still have to get the correct drivers to get it working better. I just want to see if i can use two modules on one USB device to be able to get both the command pad and keyboard input. I'm not sure if it's possible to have two modules for one USB device and would like to know that. I'll probably have to attempt to make a driver someday based off the usb keyboard driver.
 
Old 02-23-2005, 08:41 PM   #12
efanning
Member
 
Registered: Jul 2004
Distribution: Right now - Ubuntu 7.04
Posts: 81

Rep: Reputation: 15
Quote:
Originally posted by Brian1
Also a simply way to turn volume up and down is if you know the keycode to the key you wish to use for each then you can add the following to Xmodmap. This is not Gui Specific.
etc/X11/Xmodmap
Code:
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
These values are what I get when I press the volume buttons on my notebook. I also do it this way. I don't have a mute button but one can do this.
Code:
keycode 180 = XF86AudioRaiseMute
There is more than one way to do just about anything under linux.

Brian1
" Google the Linux way @ http://www.google.com/linux "
How do I find out what my keycode would be for say the volume buttons on the side of my laptop?
 
Old 02-24-2005, 11:28 AM   #13
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
type xev in the console and then hit the keys, itll display all information of the event you just triggered. i think they made 174 and 176 default, just try it anywys.
 
Old 06-24-2008, 08:59 AM   #14
rrheault
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
I have a similar problem with my hp 8710p laptop with a touch panel at the top of the keyboard for volume up, down, mute, etc... None of these buttons work with Fedora 9. Is anyone else experiencing this same issue and if so has anyone come up with a fix yet? If I run xev to capture the keycode nothing shows up.
 
  


Reply



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
PS2 keyboard doesn't work after the "Enter" key is used gonefishing SUSE / openSUSE 1 11-06-2004 10:02 PM
"Extra" moderators in the "Distro-forums" : Just curious... Megamieuwsel LQ Suggestions & Feedback 3 07-10-2004 04:18 AM
"<" ">" Keyboard keys on Toshiba Satellite 1005-s157 dont work RodCas Linux - Laptop and Netbook 1 05-08-2004 04:22 PM
Need help setting up "extra" keys on a Logitech iTouch Keyboard. Theoutdoorsman Linux - Software 4 11-16-2003 10:02 AM
Need help setting up the "extra" keys on my Logitech iTouch Keyboard Theoutdoorsman Linux - Hardware 1 10-16-2003 05:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:01 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