Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Disable PS2 mouse while typing (or fix touchpad detection)

  1. #1
    Join Date
    Mar 2010
    Beans
    178
    Distro
    Ubuntu 12.04 Precise Pangolin

    Disable PS2 mouse while typing (or fix touchpad detection)

    I think that due to

    https://bugs.launchpad.net/ubuntu/+s...ux/+bug/565543

    and in case of Elan touchpads(filed by me)

    https://bugs.launchpad.net/ubuntu/+s...cs/+bug/788109

    and (from above)
    https://bugzilla.kernel.org/show_bug.cgi?id=27442

    it is not possible to configure the Elan smart-pad touch pad. I do not mind the fancy features since I have never used those and even tap/drop works but

    I would like to disable the touch pad while typing

    Since the touch pad is not detected it is not possible to use syndaemon.

    Any ideas?

    I tagged this as all variants since this probably affects all distros since indication is that it is a kernel bug. I use Ubuntu Lucid 10.04.
    ========================================
    "If people make the final decisions, let's invest in education, not technology. " - zefrank 03-28-06
    ========================================

  2. #2
    Join Date
    Mar 2010
    Beans
    178
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    It seems that Natty would be a fix but I want to stay with Lucid. I tested Natty with LiveUSB and in Natty there was a touchpad tab in mouse preferences.

    I am pretty confident that it is a kernel bug

    https://bugs.launchpad.net/ubuntu/+s...ux/+bug/512192

    and

    https://bugs.launchpad.net/ubuntu/+bug/777424

    so it is likely that there is no easy fix to touchpad detection but is there an easy fix to disable the touchpad (i.e mouse) while typing?
    ========================================
    "If people make the final decisions, let's invest in education, not technology. " - zefrank 03-28-06
    ========================================

  3. #3
    Join Date
    Apr 2011
    Location
    Netherlands
    Beans
    22
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    To turn the touchpad on and off with a shortcut:
    I followed this: http://ubuntuforums.org/showthread.php?t=1629433
    until "Making the magic happen automatically:" and then linked the script to a shortcut.


    You might need to alter the number 7 here in the line that defines the touchpadID, since that's dependent on the number of spaces in the name.
    Code:
    touchpadID=$(xinput list | grep $touchpadString | awk -F " " '{print $7}' | awk -F "=" '{print $2}')
    I also fixed touchpad while typing, but I did not really code that properly, so I have 3 bash scripts and two python scripts with direct references to the directory they're in all over them. If the shortcut doesn't cut it, say so and I'll post them, but that's not exactly an "easy fix".

  4. #4
    Join Date
    Mar 2010
    Beans
    178
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    Hmm

    it seems that

    Code:
    touchpadID=$(xinput list | grep $touchpadString | awk -F " " '{print $6}' | awk -F "=" '{print $2}')
    does not return correct ID since the line

    Code:
    xinput --set-prop $touchpadID "Device Enabled" 0
    returns an error

    Code:
    xinput -list
    oputput

    Code:
    ⎡ Virtual core pointer                        id=2    [master pointer  (3)]
    ⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
    ⎜   ↳ Macintosh mouse button emulation            id=13    [slave  pointer  (2)]
    ⎜   ↳ ImPS/2 Logitech Wheel Mouse                 id=12    [slave  pointer  (2)]
    ⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
        ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
        ↳ Power Button                                id=6    [slave  keyboard (3)]
        ↳ Video Bus                                   id=7    [slave  keyboard (3)]
        ↳ Power Button                                id=8    [slave  keyboard (3)]
        ↳ Sleep Button                                id=9    [slave  keyboard (3)]
        ↳ 1.3M WebCam                                 id=10    [slave  keyboard (3)]
        ↳ AT Translated Set 2 keyboard                id=11    [slave  keyboard (3)]
    and I have modified the script

    Code:
    touchpadString="Logitech"
    and if I input this to terminal

    Code:
    xinput list | grep Logitech | awk -F " " '{print $6}' | awk -F "=" '{print $2}'
    I get nothing as output but if I run

    Code:
    xinput --set-prop 12 "Device Enabled" 0
    touchpad is turned off and even if I hard code

    Code:
    touchpadID="12"
    is still get the error

    Code:
    ./toggleTouchpad.sh: line 74: [: -eq: unary operator expected
    I have not installed havlevt but I do not think that is the reason.

    Can it be that the xinput --set-prop does not accept string variable?
    ========================================
    "If people make the final decisions, let's invest in education, not technology. " - zefrank 03-28-06
    ========================================

  5. #5
    Join Date
    Apr 2011
    Location
    Netherlands
    Beans
    22
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    I think that might be the case.

    What I did was just try this line in the terminal
    xinput list | grep Logitech | awk -F " " '{print $6}' | awk -F "=" '{print $2}'
    while changing the number where there is a 6 now. In my case it was 7, in your case it might be more or less. I think that using this line with the correct number should solve the problem that you're having (I recall having the same problem)

  6. #6
    Join Date
    Mar 2010
    Beans
    178
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    Excellent!

    Lucky number 7 does the trick. Next to add a hotkey. I post hat I did when ready or revert if I run in to problems.
    ========================================
    "If people make the final decisions, let's invest in education, not technology. " - zefrank 03-28-06
    ========================================

  7. #7
    Join Date
    Mar 2010
    Beans
    178
    Distro
    Ubuntu 12.04 Precise Pangolin

    Thumbs up Re: Disable PS2 mouse while typing (or fix touchpad detection)

    I moved the script to /bin and added a hot key to System->preferences->keyboard shortcuts. For command I just used the script name.

    I first tried to use alt+space but it did not work for some reason. Super+alt+space works.

    I am not fluent with the scripts so I need to ask if there are any pointers to an extremely easy way to make this so that

    1. The script runs as a daemon
    2. Script listens to keyboard event (maybe with http://gizmod.sourceforge.net/)
    3. If the script detects keyboard event the PS2 mouse is disabled until no more keyboard events are detected.

    Maybe the Gizmod alone would be enough with a correct configuration script? At least the example looks like it.

    In pseudo we would have something like

    Code:
    INTERESTED_CLASSES = [Gizmod.Keyboards]
    if Event.Class in INTERESTED_CLASSES and Event.Value != 0 \  
      if Touchpadoff !=1 
         set TouchpadOff=1
         touchpadString = "Logitech"
         touchpadID=$(xinput list | grep $touchpadString | awk -F " " '{print $7}' | awk -F "=" '{print $2}')
         xinput --set-prop $touchpadID "Device Enabled" 0
         touhpadDelay = 1
         sleep touchpadDelay
         xinput --set-prop $touchpadID "Device Enabled" 1
         set TouchpadOff=1
         endif
    endif
    Is there any idea in this and does there happen to be anyone with same problem and
    competent enough to try this out
    ========================================
    "If people make the final decisions, let's invest in education, not technology. " - zefrank 03-28-06
    ========================================

  8. #8
    Join Date
    Apr 2011
    Location
    Netherlands
    Beans
    22
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    You can try my scripts with a little effort if you want to.

    I suggest the following approach:
    Place in ~/bin, change all mentions in the script of /home/pim/bin
    to /home/username/bin (I'd too that myself, but I don't have the time atm), make all of the files excecutable. Then to test, excecute toggleSwitchInit, then toggleTouchpad, which should result in the touchpad being toggled "ON", "OFF" or "SWITCH", which is reported with a message. Switch should make sure the touchpad doesn't work while typing. The touchpad delay parameter in your code can be found in "toggleSwitchInit", but lowering it any further than 1 sec may introduce a bug.

    If it works, add toggleSwitchInit to your startup applications and point a shortcut to toggleTouchpad

    What this does, is the python script is called twice and launches two processes. One checks for keypresses and notes down the time in a hidden file. The second compares the current time to the time in the file and if Switch-mode is on and the current time is less than touchpadDelay after the file-time, the touchpad is turned off, if it's longer, it's turned on. toggleTouchpad enables switching between switch, on and off. toggleTouchpad-forscript is for the switchable mode, since toggleTouchpad cannot be used since that would turn off the switchable mode itself. pyxhook is a script that's part of the pykeylogger library, which enables listening for events.
    Attached Files Attached Files

  9. #9
    Join Date
    Mar 2010
    Beans
    178
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    Thanks

    I rummage through those when I have time and revert back here when I have done that.
    ========================================
    "If people make the final decisions, let's invest in education, not technology. " - zefrank 03-28-06
    ========================================

  10. #10
    Join Date
    May 2011
    Beans
    278

    Re: Disable PS2 mouse while typing (or fix touchpad detection)

    I'm having a similar problem with the ALPS Glidepoint. I'm not sur if it's exactly the same problem, but so far installing symantiks has not worked, editing the grub to add i8042 variations has not worked, editing the xorg.conf.d has not worked, etc.

    One of the early changes made a trackpad tab appear under the mouse preferences, but had no effect on the pad's behavior.

    I tried a mouse configuration utility, but it was unable to distinguish left button clicks fro taps, registering both as button1 clicks.

    Getting into alps-specific territory, which may not apply to the elan trackpads, linux developers argued about whether alps.c should enable tapping by default, making it IMPOSSIBLE to disable tapping without disabling the mouse, or disable tapping by default, making it possible to use the computer but slightly harder to enable tapping in software. They chose to enable tapping by default and I'm stuck with a computer which erratically clicks wherever it is dragged and erratically moves the typing location whenever one tries to type.

    At least disabling the mouse while typing would restore some functionality. But tap-to-click makes it much harder to use the GUI. [/rant] Sorry I've been trying to debug this since monday.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •