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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-20-2005, 12:41 PM
|
#1
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Rep:
|
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).
|
|
|
02-20-2005, 01:09 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
|
|
|
02-20-2005, 01:31 PM
|
#3
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Original Poster
Rep:
|
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.
|
|
|
02-20-2005, 01:47 PM
|
#4
|
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:
|
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 "
|
|
|
02-20-2005, 02:10 PM
|
#5
|
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:
|
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.
|
|
|
02-20-2005, 02:18 PM
|
#6
|
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:
|
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 "
|
|
|
02-20-2005, 02:35 PM
|
#7
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Original Poster
Rep:
|
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.
|
|
|
02-20-2005, 03:16 PM
|
#8
|
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:
|
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 "
|
|
|
02-21-2005, 12:37 PM
|
#9
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Original Poster
Rep:
|
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.
|
|
|
02-21-2005, 04:29 PM
|
#10
|
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:
|
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 "
|
|
|
02-22-2005, 07:29 AM
|
#11
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Original Poster
Rep:
|
??? 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.
|
|
|
02-23-2005, 08:41 PM
|
#12
|
Member
Registered: Jul 2004
Distribution: Right now - Ubuntu 7.04
Posts: 81
Rep:
|
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?
|
|
|
02-24-2005, 11:28 AM
|
#13
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Original Poster
Rep:
|
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.
|
|
|
06-24-2008, 08:59 AM
|
#14
|
LQ Newbie
Registered: Jun 2008
Posts: 1
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 06:05 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|