Skip to main content

How To Auto-Disable The Touchpad When The Mouse Is Plugged In Fedora 15


Hello all, hopefully this brief how-to will help others, this issue has been bugging me for years. I want the same capability in Fedora that exists in most recent versions of Windows -- disable the touchpad on my laptop if an external mouse is plugged in.  Note that my how-to is a little hardware-specific regarding the actual disabling of the touchpad; I'll discuss that more at the end of the guide.
So, here goes:
For my OS (Fedora 13 x86_64) and hardware (Dell Precision M4500) - I needed a specific utility and three scripts.  This Dell's trackpad and nipple-stick are seen as an 'internal' PS/2 mouse by Fedora, so I had to install 'xinput' to disable it (and use a very arcane little command-line). 
# yum -y install xorg-x11-apps
The enable/disable commands may be different for different hardware ... I had to use some xinput commands to figure out the values I needed:
$ xinput list
    ⎡ Virtual core pointer                        id=2    [master pointer  (3)]
    ⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
    ⎜   ↳ USB Optical Mouse                           id=10    [slave  pointer  (2)]
    ⎜   ↳ PS/2 Generic Mouse                          id=13    [slave  pointer  (2)]
$ xinput list-props "PS/2 Generic Mouse"
    Device 'PS/2 Generic Mouse':
    Device Enabled (119):    1
    ...
This told me that I could use the following:
    to disable touchpad:
xinput --set-prop "PS/2 Generic Mouse" "Device Enabled" 0
    to enable touchpad: 
xinput --set-prop "PS/2 Generic Mouse" "Device Enabled" 1
Google to learn more about using xinput.

Comments

Popular posts from this blog

Creating Custom Events in C#

First of all, to read and understand this article you should be familiar with these concepts of C# language: Inheritance Events Delegates Just to remind them very quickly: Inheritance is a feature of OOP. You can create a class and then you can create another class which has the same properties and methods of the class it is inheriting from. This could be useful for example when you need to create a class for objects like cars. You create a basic Car class and then you create some classes that inherits from Car, and in their body you add methods and/or properties. The C# syntax for inheriting a class is this: class BaseClass { /*body of the BaseClass here */ } class DerivedClass : BaseClass { /*body of the DerivedClass here */ } Events and delegates are two concepts that very often work together. When something happens on a windows form (like a click, dblclick, changin some text, selecting an item in a combobox, moving mouse, pressing a key and so on) an event is raise...

How to use Application Bar in Windows Phone 7 Application ?

      If you are working with Windows Phone 7, the first thing that you should have noticed is the very own Application bar. Application Bar is present in most of the applications that you use in your Windows Phone 7. This is basically a standard Toolbar with a menu associated with it which allows you to enumerate the commonly used commands in a standard location. While creating your application, Microsoft strongly recommends you to add an application bar, to ensure the user have common behaviour for every application. You can think Application bar similar to TaskBar of windows. Components of Application Bar An application Bar is made up with two components: 1. ApplicationBar Buttons 2. ApplicationBar Menu The applicationbar buttons are always visible for an application which is used to list only the items that needed to be frequently used while dealing with the application. Lets say you create a Text processing application, you can list the File->Ope...

WP7 Sample–Create a JPG screenshot of Bing maps control

WP7 Sample–Create a JPG screenshot of Bing maps control Today I saw a colleague ask an interesting question, how do you create a screenshot of a map that can be used in a list as a thumbnail? so I did some digging and came up with this sample that can be downloaded from the link below. http://cid-c6b45be43711d8b8.skydrive.live.com/self.aspx/Code%20Samples/wp7Sample.ScreenshotOfMap.zip In summary for those who don’t want to download the sample app, most of the work is done inside of the “Take picture” button, here is the source: // Store the size of the map control int Width = (int)mapTest.RenderSize.Width; int Height = (int)mapTest.RenderSize.Height; // Write the map control to a WriteableBitmap WriteableBitmap screenshot = new WriteableBitmap(mapTest, new TranslateTransform()); using (MemoryStream ms = new MemoryStream()) { // Save it to a memory stream screenshot.SaveJpeg(ms, Width, Height, 0, 100); // Take saved memory stream and put it back into an BitmapImage BitmapImage i...