Better solution to disabling touchpad on external mouse connection??

Hi all,
I've been playing around with a "clean" solution to disabling the Synaptics touchpad on my laptop - when I connected a USB external mouse OR when the USB mouse is already connected at boot...
I have a very hacked together solution... First for info the stock "mouse" devices on laptop...
lrwxrwxrwx 1 root root 0 26.09.2013 12:38 mouse0 -> ../../devices/virtual/input/input6/mouse0/
lrwxrwxrwx 1 root root 0 26.09.2013 12:38 mouse1 -> ../../devices/platform/i8042/serio4/input/input14/mouse1/
FYI MCE IR Keyboard/Mouse (ite-cir) and Synaptics touchpad respectively.
So I have a simple script...
#! /bin/bash
username=$(users | gawk '{print $1}')
export DISPLAY=":0"
export XAUTHORITY="/home/${username}/.Xauthority"
if $(lsusb -v | grep -q Mouse); then
synclient TouchpadOff=1
else
synclient TouchpadOff=0
fi
exit 0
that is called by a udev (/etc/udev/rules.d/01-touchpad.rules ) rule...
ACTION=="add", SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ENV{ID_CLASS}="mouse", PROGRAM="/root/Scripts/mouse_detect.sh"
ACTION=="remove", SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ENV{ID_CLASS}="mouse", PROGRAM="/root/Scripts/mouse_detect.sh"
Problem is that solution does not fire when I logout and login again, or boot from cold, into KDM/KDE... My hack to solve this problem was the following (awful!!) systemd unit...
[Unit]
Description=Mouse Detect (on Desktop Environment startup)
After=display-manager.service
Requires=display-manager.service
[Service]
Type=oneshot
RestartSec=20
Restart=always
ExecStart=/root/Scripts/mouse_detect.sh
[Install]
WantedBy=graphical.target
It's stored as mouse-detect.service in /etc/systemd/system ... It fires too early, probably when KDM is active (hence why it auto-restarts every 20 seconds).... Not even sure if it's possible to get the mouse_detect.sh script to work during the KDM Session (as I'm not sure where the Xauthority information is stored for KDM and so on)...
If I make it the service unit stop on a successful run of synclient (e.g. Restart=onfailure) - it won't every refire - if say I logout and log back into my KDE session!!
Any thoughts on how to do this more cleanly??
Given that the current solution works - I was just looking to learn some more - by implementing a less hacked version!! 
Thanks
Bob
Last edited by bobwya (2013-09-26 14:25:52)

Zamajalo wrote:What about using one simple udev rule? Manual can be found here
The udev rule falls down when you boot with a USB mouse already attached to the laptop - on boot (as I clearly stated). The rule only detects change of state (mouse attached or detached). Also what if you have 2 USB mice attached?? :-) The udev idea of what a "mouse" is - is also rather generic (e.g. touchpad, infrared remote control are definitely not USB mice!!)
The script is overkill for running from a udev rule (- although it does have the benefit of not have a hard-coded username). However the script is necessary to test for a mouse being attached - when a KDE session starts. That was basically what my question was about... How to run this script at the start of the KDE session - my use of lsusb is annoying - because it means the script must run as root (due to the verbose flag)... There must be a way to do this as a normal desktop user (and then the script should run OK in a normal autostart desktop script).
Thanks
Bob

Similar Messages

  • Can't disable touchpad when external mouse connected

    Hey guys,
    OS: Win7 64Bit
    Product : b0p18pa#ab4
    Model: dv6-7007tx
    The only way i've figured out a way to disable the touchpad is to uninstall the PS/2 compatible mouse in device manager. (which requires a restart) to come into effect and is reinstalled after the next restart afterwards.
    the touchpad is SO sensitive it makes it extremely aggrivating to type as i keep tapping  the pad with my palms.
    any insight would be fantastic.
    cheers guys.

    Hi,
    Please try:
       Control panel > Mouse > ClickPad Settings
       Tick Disable internal pointing device when .....
       Click Apply
    Regards. 
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to disable UltrNav when external mouse connected

    Is there a way to have the UltraNav turned off automatically when an external mouse is connected?
    When typing it’s too easy to inadvertently touch the UltrNav and if you’re not watching find you’re typing in a different location, so we like to turn it off. But when I need to quickly access the laptop I would like to use the UltrNav and not have to find and connect the mouse.
    I can turn it off/on through the control panel/system tray, however it’s near impossible to turn on without a mouse.
    Our users have gotten use to this feature in other laptop brands but according to the Lenovo help desk it’s not available.  

    Hi, GDodman
    Unfortunately, I don't think this option is currently supported on Lenovo Think brands. I did some research on the topic and attempted to change the settings of UltraNav, but was not able to find this function. If you find that UltraNav is too easy to inadvertantly tap while typing, then I would recommend changing the sensitvity to a lower setting to reduce future misclicks and random movements.
    Best of luck,
    Adam
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution!" This will help the rest of the community with similar issues identify the verified solution and benefit from it.

  • Problem with udev rule to disable touchpad when USB mouse connects

    Hi, I've been running Arch on this laptop, but I can't get this udev rule to work properly.
    What I want to happen is: when I plug in my usb mouse, the laptop touchpad is disabled, and the left and right buttons are reversed (I'm left handed)
    After following several tutorials, both from the arch wiki and other sites, I've come up with this udev rule:
    ACTION=="add", SUBSYSTEM=="input", RUN+="/usr/local/bin/USBMouse.sh"
    ACTION=="remove", SUBSYSTEM=="input", RUN+="/usr/local/bin/USBMouse.sh"
    And here's the script it links to (USBMouse.sh):
    #!/bin/bash
    export DISPLAY=:0.0
    synclient TouchPadOff=$(/usr/bin/lsusb | grep "Microsoft Corp.\
    Nano Transceiver v1.0 for Bluetooth" | wc -l)
    if [[ $(/usr/bin/lsusb | grep "Microsoft Corp.\
    Nano Transceiver v1.0 for Bluetooth" | wc -l) == 1 ]]
    then
    xmodmap -e 'pointer = 3 2 1'
    fi
    if [[ $(/usr/bin/lsusb | grep "Microsoft Corp.\
    Nano Transceiver v1.0 for Bluetooth" | wc -l) == 0 ]]
    then
    xmodmap -e 'pointer = 1 2 3'
    fi
    Running the script from a terminal returns no errors and works as expected. The problem is when I plug/unplug the mouse from the usb port, nothing happens.
    I appreciate any insight you might have about how to fix this, and thank you in advance

    This has already been done. And another relevant thread.

  • Laptop touchpad, keyboard, external mouse problem

    I have an HP Pavilion dv6-6c35dx laptop.
    It is running Windows 7 Ultimate 64 bit OS.
    I have been using my latop for college work and a little gaming since I got over a year ago. I haven't had any problems with it up until now. During that time I have been using a Logitech G700 external mouse instead of the touchpad (which has worked the whole time). Literally out of no where my external mouse kind of stopped working. The pointer icon would move across the screen but I could not click on anything. During this time, the touchpad would sometimes work, and other times not work in much the same way as the external mouse. Also too, the keyboard wouldn't work at all. All the drivers were installed and up to date. I decided to do a reformat as I was due for one anyway but I wanted to save all my data first. I tried using a Knoppix boot CD to do this but for whatever reason it wouldn't load, stating that it couldn't find/access the filesystem. Safe mode worked and I was able to save my data, miracuously with the touchpad. I performed a reformat and installed all the drivers and returned my notebook to its factor settings. I reinstalled my G700 software and it worked for about the first 5 minutes, then I was back to square one. I'm not sure what to do at this point. 

    A404error,
    I am glad you were able to find your solution, and thank you for posting it in case someone else in the community is having a similar issue.
    If you have any further issues don’t hesitate to ask.
    Have a great day. 
    Clicking the White Kudos star on the left is a way to say Thanks!
    Clicking the 'Accept as Solution' button is a way to let others know which steps helped solve the problem!

  • CP60-615DX Touchpad and external mouse no longer work after WIndows 7 SP1 update

    Let me start by saying I am in the IT field, though clearly far from being great at it. I was updating a CP60-615DX at work with Win 7 x64 SP1. It installed with no errors or anything I'd consider abnormal. Once it was finished, the touchpad no long worked, as well as any mouse I'd hook up via Usb. So I checked Device manager, and the Touchpad is listed with the yellow exclamation mark, as well as mice I hook up. So I did what any respectable IT guy would do, I went to HP and downloaded x64 drivers for the Touchpad port and installed them. But they didn't fix the issue, literally nothing happened. So I installed the latest chipset drivers. Still nothing changed. So I uninstalled the device and manually added it by doing the advanced driver install for a new device, pointing it to the directory where the .exe file had placed the drivers. ...Nothing. So I uninstalled SP1,.... nothing. After uninstalling SP1, redid every aforementioned step, nothing. So my question is, **bleep**? Anyone know another way to fix an issue where the scrolling devices stop working and the drivers won't fix the issue? 
    Btw, the user had never set up windows restore, and my only other thought is pulling personal documents off and restoring to factory defaults. One more bit of info before I forget, when I went into Windows Recovery (which loads a pre-environment mini OS for you to restore and fix issues), the mouse worked, telling me it's not a hardware issue, it's a Windows vs devices issue.

    Hi,
    According to your description, since system reinstallation is not helpful, it's probably a hardware problem, it would be better to check if it is the device itself problem.
    Roger Lu
    TechNet Community Support

  • How to disable touchpad when usb mouse in on HP ENVY dv7-7259nr Notebook PC‏ using Windows 7

    I would like to have my touch pad disabled when using my USB mouse or otherwise be able to manually disable it.  It is a pain to use when typing with the touch pad enabled but I would like to use the touch pad on occasions such as when I am traveling or if my mouse goes out. Not to mention, I would need to re-enable the touh pad if for some reason I have no mouse (keyboard shortcut?)
    I am using windows 7 on my HP ENVY dv7-7259nr Notebook PC‏

    This is what it looks like. 
    You should consider returning you notebook to the Windows 8 OS. There are many new features that it has that Windows 7 never did. Download use the free open source software called classic shell to give yourself a start button in Windows 8 that even has more features than Windows 7 start buton does. Once you use Windows 8 for a while you will enjoy it, especially the refresh feature and lower memory use. 
    I wouldn't hold my breath waiting for Windows 7 drivers.
    regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Satellite Pro A300 - Cursor constantly moves when external mouse connected

    Hi there
    I have a Satellite Pro A300. When I attach a mouse directly by USB the cursor is constantly moving. I also have a mouse attached via a Toshiba docking station and that works perfectly.
    It doesn't matter which USB port I use or whether the laptop is connected to the docking station or not, or whether it is running on mains or battery power.
    I thought it was the mouse that was the problem so I went and bought a new one but the problem is persisting.
    Actually, while I have been writing this post, it has stopped doing it and then started again! Very frustrating.
    Can anyone help?
    Thanks
    Susib

    Hi
    How about the touchpad does the cursor moves and jumps using the touchpad?
    Try to disable the touchpad while using the USB mouse check if you can notice a difference
    How about BIOS?
    Do you have the latest version installed?
    Check this!

  • Option to disable UltraNav (touchpad + trackpoint) when external mouse is connected

    I grabbed the 5/2011 drivers for UltraNav from the Lenovo site and it appears that an option 'to disable the integrated pointing devices when an external pointing device is present' does not exist, or at the very least I can't easily find it.  Please please please please tell me I'm simply being dense and this behavior is very easy to enable.
    Seriously, the 5-year old Dell drivers I had with my old machine did that, and this is driving me BONKERS.
    Alternatively, if what I'm doing here is feature-requesting, I'd be like 50% there if I could Fn+F8 and have an option to kill both the touchpad and the trackpoint - alas, I can disable 1 or the other BUT NOT BOTH WITH THAT OPTION.  Can I really not disable both?
    Lenovo W520, Windows 7 Professional 64-bit.

    Even though it passed some time from first post I'm writing a solution for auto disabling UltraNav touchpad and trackpoint when external mouse is connected.
    I have Lenovo L530 that doesn't have shortcut on keyboard to disable Elantech touchpad so after a driver update (from about 20 March 2013) I tried to find a solution again -now with success.
    To auto disable touchpad when external mouse is connected you have to set value in registry editor here is procedure (for Windows 7 procedure for other Windows editions is similar or same):
    Click Windows type in regedit and run it.
    Navigate to HKEY_CURRENT_USER\Software\Elantech\OtherSetting. (If you can't find Elantech\OtherSetting in HKEY_CURRENT_USER navigate to HKEY_LOCAL_MACHINE\Software\Elantech\OtherSetting.)
    Find DisableWhenDetectUSBMouse double click it and change value (from 0) to 1, hit OK.
     (If you don't have DisableWhenDetectUSBMouse in Elantech\OtherSetting create new DWORD with name DisableWhenDetectUSBMouse and set value to 1.)
    Restart computer.
    I hope someone still find this helpful.

  • How can i automatically turn touchpad off when mouse is connected

    The "Disable touchpad when external mouse is connected" button is not on my Settings menu for the touchpad.
    Solved!
    Go to Solution.

    could you please try this?
    http://www.riverscapewebstudios.com/2012/03/using-registry-to-disable-synaptics-touchpad-when-mouse-...

  • Mac Book Pro (3 Jahre alt): Mouse (Touchpad wie externes Gerät) springt unkontrolliert

    Brauche dringend Hilfe. Seit gestern springt meine Mouse (Touchpad wie auch die extern angeschlossene) unkontrolliert auf dem Bildschirm rum. Kann nicht wirklich arbeiten. Ständig klickt sie irgendwas an und bewegt sich eben auch, obwohl ich meine Hände nicht mal in der Nähe vom Touchpad oder der Mouse habe.
    Kennt sich jemand mit diesem Problem aus? Gibt es irgendwas, was ich tun kann, bevor ich in den Laden rennen muss?
    Danke!

  • Cannot disable touchpad on HP G60-243CL

    I want to disable the touchpad on my G60-243CL because I almost always use an external mouse. However, the touchpad continues to work when I press the touchpad on/off button. The only thing that happens is that the touchpad light switches from white to amber and vice versa when I press the button. The touchpad continues to work just as before.
    Anyone know how to solve this strange problem? I find it odd that the touchpad doesn't turn off even when I press the touchpad on/off button, which is supposed to affect the hardware directly and override software settings.

    Ok, so I found the solution to making the button work. (At least, for Windows 7 owners.) First, you have to go into start, then type mouse into your search box. You should see an option that says change mouse settings. Click on it. From there, click the hardware tab. Click on the mouse device you're having problems with. From there, click the Properties button near the lower right-hand corner of the window. A new window should pop up. In the new window, click the Driver tab. Now, click Update Driver. Then click "Search Automatically for Updated Driver Software". After a few minutes, the update will complete, and you will be prompted to restart your computer. After that, it should work just fine.

  • GS70 2OD-001US mouse pad / external mouse issue

    Hi,
    Just bought GS70 2OD-001US (http: //www. microcenter.com /product/418785/GS70_2OD-001US_173_Laptop_Computer_-_Brush_Aluminum_Grey).
    The laptop seems to be great. However, when I use external wireless OR wired USB mouse, then mousepad stops working!!
    Anyone knows a fix for this (very annoying).
    Thanks

    Quote from: crracer_712 on 03-January-14, 06:51:40
    Look in the system tray and open the properties for the touchpad.  You'll have to enable it, because by default, it is set to disable when a usb mouse is plugged in.
    Awesome. That was the issue. Thanks

  • Satellite A100-033: I disabled touchpad and now Fn+F9 doesn't enable it

    I have a Toshiba Satellite A100-033 running Vista Home Basic. I mostly use the laptop as a desk top replacement and, as I dislike using the touchpad, I disabled it, and instead I use an external mouse via one of the USB ports.
    I am not sure whether I disabled the touchpad by pressing Fn + F9 or by some other means (if it was by some other means I have forgotten what this was). Recently I wished to re-enable the touchpad so that I could use the laptop outside the house. However, I found that pressing Fn & F9 did not re-enable the touchpad and I now can't use the touchpad at all.
    If I go into mouse properties (in control panel), this tells me that my synaptics pointing device is enabled. If I go into device manager and look at "mice", I am told that my touchpad is working properly.
    All this makes me suspect that the problem is not a hardware fault but that I have altered some setting, with the result that my touchpad is permanently disabled until I change the setting back to its original state.
    Help!

    Jayjay, Thanks for your suggestions. I don't seem to have a system restore point which goes back far enough, so I don't think that possibility will work.
    Regarding the possibility of reinstalling the touchpad driver, I may have to do this, but I am a bit put off by the fact that when I downloaded the touchpad driver from the Toshiba site and had a look at it, I was told that it was older than the one I already have on my laptop.
    (My laptop is a year old and the touchpad driver on the Toshiba website was last updated in early 2007.)
    I'm a bit reluctant to install a driver which is older than the one which I have already got and which my laptop tells me is working properly.
    As I said, I may have to try re-installing the touchpad driver anyway, but I think I will wait a bit first, and see if I get any other suggestions.
    Thanks again for your reply.

  • TrackPoint, Touchpad and Bluetooth Mouse

    Hi there,
    I tried to get my SE K800i working as a Bluetooth mouse in X. On my Desktop everything works fine. I just use /dev/input/mice with the "mouse"-driver in xorg.conf and as soon as the BT mouse connects, I can use it.
    Unfortunately I can't do this on my laptop (ThinkPad T41). I have to configure each mouse separately to make full use of the stick and touchpad, so I can't use /dev/input/mice. The BT mouse will always show up as /dev/input/mouse3.
    Is there a way to configure X, so that it recognizes /dev/input/mouse3 as soon as it shows up? I don't want to restart X every time I have to use the BT mouse (mostly for presentations).
    Thanks,
    Pavel

    I know you did, I was simply explaining fully (perhaps other people have this issue too and would like to know more). When I said 'mouse pointer speed' I simply meant 'pointer speed' (i.e. for both devices, not for the +bluetooth mouse+), the terminology is confusing.
    The Pointer Speed slider in the Pointer Options of the Mouse control panel is not, strictly speaking, for the external/bluetooth +mouse+, but a system-wide, global option for the +pointer+.
    I guess I knew there wouldn't be an easy answer. If Toshiba/Synaptics take note of these forums, perhaps we can look forward to a solution.

Maybe you are looking for