Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

USB Mouse and Keyboard How-To

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
45 posts
  • 1
  • 2
  • Next
Author
Message
Vlad
Apprentice
Apprentice
Posts: 264
Joined: Tue Apr 09, 2002 8:47 pm
Location: San Diego, California

USB Mouse and Keyboard How-To

  • Quote

Post by Vlad » Sat Apr 13, 2002 2:53 am

Installing a USB Mouse and/or Keyboard in Gentoo

Forward: The following document assumes that you are using at least a USB Mouse or Keyboard and have the ability to recompile the “gentoo-sources” kernel. This document presents the installation of USB drivers in a "modular" form to better diagnose any problems that you may encounter. When using a USB mouse and keyboard, however, it may be preferable to compile the USB drivers statically into the kernel. If you have any further questions or problems, you may wish to read over the USB HID Configuration Guide from www.linux-usb.org before posting a question.

This document is broken down into three sections:

1. USB Mouse (only)
2. USB Keyboard (only)
3. USB Mouse & Keyboard


USB Mouse Howto:

1. Enter your kernel configuration

Code: Select all

cd /usr/src/linux
make menuconfig 
2. Once in the configuration screen, scroll down to Input Core Support, and
hit enter.

3. Hit "m" for Input Core Support. Scroll down to Mouse Support, and hit “m”. Exit from this menu.

4. Scroll down to USB support and hit enter.

5. In USB Support, hit “y” at “Support for USB”. Scroll down to "Preliminary USB device filesystem" and hit “y”. Include either "UHCI (Intel PIIX4, VIA, ...) support" or "UHCI Alternate Driver (JE) Support" as modules (“m”). Finally, include "USB Human Interface Device (full HID) support" as a module (“m”). Include “HID input layer support” with “y”.

6. Exit USB Support, then exit the menuconfig. Now do "make dep && make clean bzImage modules modules_install".

7. The following new modules will be created:
  • Modules Name..................................Path to modules

    1a. UHCI (Intel PIIX4, VIA,...)............ /lib/modules/kernel-version/kernel/drivers/usb/usb-uhci.o
    or
    1b. UHCI Alternate Driver (JE) support /lib/modules/kernel-version/kernel/drivers/usb/uhci.o
    2. USB Human Interface Device....... /lib/modules/kernel-3. version/kernel/drivers/usb/hid.o
    3. Input Core Support..................... /lib/modules/kernel-version/kernel/drivers/input/input.o
    4. Mouse Support............................ /lib/modules/kernel-version/kernel/drivers/input/mousedev.o
8. Be sure to mount your /boot partition and copy over the new kernel image!

9. Edit your /etc/modules.autoload file and add the following lines:

Code: Select all

input
mousedev
hid
usb-uhci (or uhci)
10. Reboot your machine to test your new drivers.

11. If everything goes well, your modules should all load ok.

12. To ensure your mouse works in X, be sure to edit /etc/X11/XF86Config. Here is an example:

Code: Select all

Section "InputDevice"

# Identifier and driver

    Identifier  "Mouse1"
    Driver      "mouse"
    Option "Protocol"    "IMPS/2"
    Option "Device"      "/dev/input/mice"
    Option "ZAxisMapping"       "4 5"
Note: If /dev/input/mice doesn't work, try using /dev/usbmouse. Thanks to rac for bringing this to my attention. :)


USB Keyboard Howto:

Note: When using a USB keyboard there are two things you should be aware of: First, if something goes wrong with loading your modules, your keyboard will not function. This is why I do NOT recommend loading your USB keyboard in modular form. Secondly, many newer BIOS's include automatic support for USB keyboards (so you don't technically need to to build support for them). Either way, BE SURE TO READ THIS DOCUMENT BEFORE PROCEEDING: http://www.linux-usb.org/USB-guide/x194.html

1. Enter your kernel configuration

Code: Select all

cd /usr/src/linux
make menuconfig 
2. Once in the configuration screen, scroll down to Input Core Support, and hit enter.

3. Hit "y" for Input Core Support. Scroll down to Keyboard Support, and hit “y”. Exit from this menu.

4. Scroll down to USB support and hit enter.

5. In USB Support, hit “y” at “Support for USB”. Scroll down to "Preliminary USB device filesystem" and hit “y”. Include "USB Human Interface Device (full HID) support" as a module (“y”). Include “HID input layer support” with “y”.

6. Exit USB Support, then exit the menuconfig. Now do "make dep && make clean bzImage modules modules_install".

7. No modules need to be loaded for your USB keyboard.

8. Be sure to mount your /boot partition and copy over the new kernel image!

9. Reboot your machine to test your new drivers.


USB Mouse and Keyboard Howto:

Note: When using a USB keyboard there are two things you should be aware of: First, if something goes wrong with loading your modules, your keyboard will not function. This is why I do NOT recommend loading your USB keyboard in modular form. Secondly, many newer BIOS's include support for USB keyboards. But this BIOS support is overridden when you load usb HID support. So you can start with keyboard support and lose it when loading one of the uhci modules or when loading a kernel with HID support built in. Better to build keyboard support into the kernel to be safe, since you can work without a mouse but not without a keyboard. Either way, BE SURE TO READ THIS DOCUMENT BEFORE PROCEEDING: http://www.linux-usb.org/USB-guide/x194.html

1. Enter your kernel configuration

Code: Select all

cd /usr/src/linux
make menuconfig 
2. Once in the configuration screen, scroll down to Input Core Support, and hit enter.

3. Hit "y" for Input Core Support. Scroll down to Keyboard Support and hit “y”. Scroll down to Mouse Support and hit “y”. Exit from this menu.

4. Scroll down to USB support and hit enter.

5. In USB Support, hit “y” at “Support for USB”. Scroll down to "Preliminary USB device filesystem" and hit “y”. Hit “y” at “UHCI (Intel PIIX4, VIA, ...) support” or “UHCI Alternate Driver (JE) support,” whichever you prefer. Include "USB Human Interface Device (full HID) support" by hitting “y”. Finally, hit “y” at “HID input layer support.”

6. Exit USB Support, then exit the menuconfig. Now do "make dep && make clean bzImage modules modules_install".

7. No modules will be created during this installation; instead, everything will be statically compiled into the kernel.

8. Be sure to mount your /boot partition and copy over the new kernel image!

9. Reboot your machine to test your new drivers.

10. If everything goes well, your USB mouse and keyboard should work flawlessly.
Top
duff
Guru
Guru
User avatar
Posts: 466
Joined: Wed Jun 19, 2002 1:47 am
Location: Clemson, SC

  • Quote

Post by duff » Wed Aug 28, 2002 5:15 pm

Great little HOWTO! Now I can throw any my PS/2 to USB converter. :D

Since this was dead last in the forum...upping for anyone who's yet to see this.
Top
wing
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 108
Joined: Tue Aug 27, 2002 4:24 pm
Location: Mountain View, CA

  • Quote

Post by wing » Fri Aug 30, 2002 4:45 am

if you look, /dev/usbmouse is a symlink to /dev/input/mice ...
Top
zenhonky
n00b
n00b
Posts: 4
Joined: Fri Aug 30, 2002 8:21 pm

  • Quote

Post by zenhonky » Fri Aug 30, 2002 8:36 pm

bump

This guide is awesome. Thank you very much.
"Be true to yourself and you will never fall" - Beastie Boys
Top
rafeco
n00b
n00b
Posts: 17
Joined: Sat Aug 31, 2002 2:11 am
Contact:
Contact rafeco
Website

very nice

  • Quote

Post by rafeco » Tue Sep 03, 2002 2:40 pm

Thanks for the HOWTO, very useful indeed.
Top
carl67lp
n00b
n00b
Posts: 8
Joined: Sun May 12, 2002 3:25 pm
Location: Michigan, USA

  • Quote

Post by carl67lp » Sat Oct 12, 2002 3:48 pm

Thank you for an excellent HOW-TO. I realized that I had my kernel properly configured but the modules were not loaded. I loaded them up, and now am installing Mozilla on my Linux box as I type.

Thanks!
Top
rac
Bodhisattva
Bodhisattva
User avatar
Posts: 6553
Joined: Thu May 30, 2002 6:19 am
Location: Japanifornia
Contact:
Contact rac
Website

  • Quote

Post by rac » Sun Nov 10, 2002 8:50 pm

The discussion that started with Youda's post about the intellimouse explorer has gone to Trouble with Intellimouse Explorer. Please don't post support questions to threads in Documentation, TIps and Tricks.
For every higher wall, there is a taller ladder
Top
rac
Bodhisattva
Bodhisattva
User avatar
Posts: 6553
Joined: Thu May 30, 2002 6:19 am
Location: Japanifornia
Contact:
Contact rac
Website

  • Quote

Post by rac » Mon Nov 25, 2002 8:14 pm

mawst's question about gpm has gone to GPM + USB Mouse. Please don't post support questions to threads in Documentation, Tips and Tricks.
For every higher wall, there is a taller ladder
Top
TilTNimpuS
n00b
n00b
Posts: 1
Joined: Tue Apr 01, 2003 10:25 pm
Location: Metz

ThkS

  • Quote

Post by TilTNimpuS » Tue Apr 01, 2003 10:28 pm

thks guy !
C ma Faute si ca plante !!! ;-)
Top
Kreek
n00b
n00b
User avatar
Posts: 14
Joined: Tue Apr 01, 2003 6:20 pm

Now you tell me!

  • Quote

Post by Kreek » Tue Apr 01, 2003 10:43 pm

Wish I'd read this post about a week ago! :wink:
Oh well! I learned a lot doing it on my own!!! :D :) :D
One OS to rule them all,
One OS to find them.
One OS to bring them all,
and in the darkness bind them.
Top
Nakke
n00b
n00b
Posts: 13
Joined: Wed Jan 15, 2003 9:43 am

  • Quote

Post by Nakke » Wed Apr 02, 2003 8:33 am

Now tell me how to use a usb keyboard in Grub/Lilo. :?
Top
duff
Guru
Guru
User avatar
Posts: 466
Joined: Wed Jun 19, 2002 1:47 am
Location: Clemson, SC

  • Quote

Post by duff » Wed Apr 02, 2003 2:22 pm

Nakke wrote:Now tell me how to use a usb keyboard in Grub/Lilo. :?
Check your BIOS. That has nothing to do with Linux.
Top
Scorp
Tux's lil' helper
Tux's lil' helper
Posts: 118
Joined: Sun Feb 16, 2003 6:18 am

  • Quote

Post by Scorp » Mon Apr 07, 2003 4:44 pm

LILO sees my keyboard, I think my BIOS sees my keyboard, yet linux doesn't.... I'm compiling support in now. Thanks for the great how-to.
PowerBook G3, 400 Mhz, 192 megs of Ram Running Gentoo 1.4 and XFCE4
Top
static
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 141
Joined: Thu Apr 18, 2002 6:05 pm
Location: Canada

  • Quote

Post by static » Wed Jul 09, 2003 5:06 pm

8)
Just re-reading this for the first time in about 8 months (it's been reworked nicely) and I was curious - did gentoo do something to fix usb mice working when support is compiled right into the kernel?? 'Cause the mouse only section still says to use modules as it used to, but the keyboard & mouse section implies the mouse will work if its all compiled right in, which never used to work.
Gentoo and Doom III. 'Nuff Said.
_______________________________________
Top
se-reeh
n00b
n00b
Posts: 3
Joined: Mon Jul 07, 2003 8:31 pm

  • Quote

Post by se-reeh » Wed Aug 06, 2003 3:47 pm

Thanks! It works with my Logitech Optical Mouse (M-BJ58) connected via USB. Great HowTo. Thanks a lot! :D
Top
Joe_Bogarde
n00b
n00b
User avatar
Posts: 45
Joined: Sun Jun 01, 2003 7:37 am
Location: Ellensburg WA

  • Quote

Post by Joe_Bogarde » Sun Sep 21, 2003 11:45 pm

Delightful, wonderful, very helpful.
"Persons attempting to find a motive in this narrative will be prosecuted; persons attempting to find a moral in it will be banished; persons attempting to find a plot in it will be shot." Mark Twain.
Top
genttoo_ed
n00b
n00b
Posts: 7
Joined: Wed Sep 24, 2003 10:25 pm

Update on HOWTO

  • Quote

Post by genttoo_ed » Thu Sep 25, 2003 12:41 am

I have recently installed the Stage 3 , binary version of Gentoo 1.4.

Some of this information on the mouse is not correct with my installation.

There were no /lib/modules/dirvers//input/* modules. Just the joystick, nevertheless the mouse worked.
Top
AsianInvasion
n00b
n00b
Posts: 4
Joined: Thu Sep 25, 2003 11:16 pm

  • Quote

Post by AsianInvasion » Thu Sep 25, 2003 11:20 pm

I am trying to get Mandrake 9.1 to recognize my USB keyboard. I opened a terminal(Gnome) and typed:

cd /usr/src/linux-2.4.x
make menuconfig

After i type that i get a message that says "No rule to make target 'menuconfig'. Stop. what does that mean? and how can i fix it and run menuconfig.


Thanks Alot.
Top
AsianInvasion
n00b
n00b
Posts: 4
Joined: Thu Sep 25, 2003 11:16 pm

USB KEYBOARD

  • Quote

Post by AsianInvasion » Fri Sep 26, 2003 5:01 pm

I fixed the error i posted before, by installing the kernel-source-2.4.21-0.13mdk.i586.rpm.

but it still didn't work. I'm thinking i didn't mount the /boot correctly. or i didn't copy the kernel image. can someone explain how to do these to in depth? thank you.

as you can tell i am a newbie. thanks again
Top
AsianInvasion
n00b
n00b
Posts: 4
Joined: Thu Sep 25, 2003 11:16 pm

USB KEYBOARD

  • Quote

Post by AsianInvasion » Fri Sep 26, 2003 5:02 pm

I fixed the error i posted before, by installing the kernel-source-2.4.21-0.13mdk.i586.rpm.

but it still didn't work. I'm thinking i didn't mount the /boot correctly. or i didn't copy the kernel image. can someone explain how to do these to in depth? thank you.

as you can tell i am a newbie. thanks again
Top
AsianInvasion
n00b
n00b
Posts: 4
Joined: Thu Sep 25, 2003 11:16 pm

  • Quote

Post by AsianInvasion » Fri Oct 03, 2003 2:37 am

I did what the first person said to do, and now i get the num lock light to come on, on my usb keyboard, but it still won't type. so i know i'm making progress, but does anybody know what else to do? thanks
Top
xjumper84
n00b
n00b
Posts: 11
Joined: Tue Sep 23, 2003 10:06 am
Location: CA
Contact:
Contact xjumper84
Website

  • Quote

Post by xjumper84 » Tue Nov 25, 2003 3:59 am

this did not work, and now my laptop doesn't work
Top
Jazz
Guru
Guru
User avatar
Posts: 543
Joined: Sun Nov 16, 2003 10:50 pm
Location: Melbourne, Australia

  • Quote

Post by Jazz » Tue Nov 25, 2003 2:05 pm

DOH !!! SUCH A BEA-AA-U-TIFUL guide !!!!

Why is it not in the Gentoo official Guides ???? (*hint*)

Well looking forward to it !!

Bye,
Jassi
Top
To
Veteran
Veteran
User avatar
Posts: 1145
Joined: Sat Apr 12, 2003 9:12 pm
Location: Coimbra, Portugal
Contact:
Contact To
Website

  • Quote

Post by To » Thu Nov 27, 2003 1:32 pm

Great how-too, thanx :wink:
I only had a problem cause my nforce2 motherboard uses ohci instead of uhci. Maybe ppl should try both options ( without having the other one selected, not even has a module... ).

Tó

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Top
dredd
n00b
n00b
Posts: 63
Joined: Thu Nov 27, 2003 4:09 pm
Location: Switzerland

  • Quote

Post by dredd » Sun Nov 30, 2003 2:25 pm

hi

nice little how-to.... I've did all the steps as described, but it won't load the modules input, mousedev and usb-uhci. seems like i cannot find them in /lib/modules/linux-2.4.20-gentoo-r8/drivers/input/

what the hell am I doing wrong? when I do a locate for those modules I can find them in
/usr/src/linux-2.4.20-gentoo-r8/drivers/input/ but well.... that doesnt help me...

any hints what I have to do?

thanks in advance...
Top
Post Reply

45 posts
  • 1
  • 2
  • Next

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy