0

i bought a cheap Touchpad (Speedlink Sway), but only the pointer works. I can't use the tap, nor the hardware keys.

Device:

Bus 003 Device 008: ID 062a:2901 Creative Labs 

Xinput:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Paten    USB Gaming Mouse                     id=17   [slave  pointer  (2)]
⎜   ↳ HID 0566:3013 Consumer Control            id=14   [slave  pointer  (2)]
⎜   ↳ iTouch Pad iTouch Pad Mouse               id=18   [slave  pointer  (2)]
⎜   ↳ iTouch Pad iTouch Pad Consumer Control    id=11   [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)]
    ↳ HID 0566:3013 System Control              id=15   [slave  keyboard (3)]
    ↳ HID 0566:3013 Consumer Control            id=19   [slave  keyboard (3)]
    ↳ HID 0566:3013                             id=13   [slave  keyboard (3)]
    ↳ HID 0566:3013                             id=16   [slave  keyboard (3)]
    ↳ iTouch Pad iTouch Pad Consumer Control    id=12   [slave  keyboard (3)]
    ↳ iTouch Pad iTouch Pad                     id=10   [slave  keyboard (3)]

Props:

xinput watch-props 18
Device 'iTouch Pad iTouch Pad Mouse':
    Device Enabled (177):   1
    Coordinate Transformation Matrix (179): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (316):   1
    libinput Natural Scrolling Enabled Default (317):   0
    libinput Scroll Methods Available (320):    0, 0, 1
    libinput Scroll Method Enabled (321):   0, 0, 1
    libinput Scroll Method Enabled Default (322):   0, 0, 0
    libinput Button Scrolling Button (323): 1
    libinput Button Scrolling Button Default (324): 2
    libinput Middle Emulation Enabled (325):    1
    libinput Middle Emulation Enabled Default (326):    0
    libinput Accel Speed (327): 0.000000
    libinput Accel Speed Default (328): 0.000000
    libinput Accel Profiles Available (329):    1, 1
    libinput Accel Profile Enabled (330):   0, 0
    libinput Accel Profile Enabled Default (331):   1, 0
    libinput Left Handed Enabled (332): 0
    libinput Left Handed Enabled Default (333): 0
    libinput Send Events Modes Available (301): 1, 0
    libinput Send Events Mode Enabled (302):    0, 0
    libinput Send Events Mode Enabled Default (303):    0, 0
    Device Node (304):  "/dev/input/event9"
    Device Product ID (305):    1578, 10497
    libinput Drag Lock Buttons (318):   <no items>
    libinput Horizontal Scroll Enabled (319):   1

Keys:

xinput get-button-map 18
1 2 3 4 5 6 7 8 9 

But xev (nor KeyMon) does not show any reaction if I use the hardware keys or the tap function. Strange thing: I can use tap-hold to use the scrolling-function, but xev also does not show any reaction. Anyway: I can't use the touchpad, because I can't use a left, nor a right click.

Any suggestions? TIA Mierscheid

3 Answers 3

0

I seem to recall encountering this too. Have you had a look at system settings > mouse & touchpad > devices > touchpad and then enable "Tap to click"

settings window

0

Of course I had. :-) I can choose whatever I want: Nothing happens.

enter image description here

0

The problem is still present. But not only on elementaryOS, but on other distros as well (e.g. Mint 21.2).

Interestingly, "xinput --query-state" correctly reports the pressed buttons.

So I have created a little proof-of-concept in Python, which uses "xinput" and "xdotool" to emulate the button presses. This, at least, makes the SWAY Trackpad usable. But be warned: This script executes "xinput" 20 times a second, so do not use this in production.

#!/usr/bin/python3

import os
import subprocess
import time

def put(t): print(t)

DEVICE_NAME = 'iTouch Pad iTouch Pad Mouse'
THROTTLE = 0.05

button_state = {1:None, 2:None}
value_state = {0:0, 1:0}

# Command line to query device state
query_cmds = ['/usr/bin/xinput', '--query-state', DEVICE_NAME]

while True:
    # Query state
    r = subprocess.run(query_cmds, stdout=subprocess.PIPE).stdout
    
    # Parse result lines
    for l in r.split(b'\n'):
        #put('"%s"' % l)
        
        # Handle "button" results
        if l.startswith(b'\tbutton['):
            
            # Extract button_num and value. @TODO: Use regexp
            i_out = l.index(b']')
            button_num = int(l[l.index(b'[')+1:i_out])
            value = True if l[i_out+2:] == b'down' else False
            
            # Issue xdotool if value changed
            old_value = button_state[button_num] if button_num in button_state else None
            if value != old_value:
                cmd = '/usr/bin/xdotool %s %d' % ('mousedown' if value else 'mouseup', button_num)
                os.system(cmd)
            button_state[button_num] = value
        
        elif l.startswith(b'\tvaluator['):
            i_out = l.index(b']')
            # Extract value_num and value. @TODO: Use regexp
            i_out = l.index(b']')
            value_num = int(l[l.index(b'[')+1:i_out])
            value = int(l[i_out+2:])
            
            old_value = value_state[value_num] if value_num in value_state else None
            #if value != old_value: # Call xdotool if value changed
            if value != old_value and button_state[1]:  # Call xdotool if value changed AND only while dragging
                x = value_state[0]
                y = value_state[1]
                cmd = '/usr/bin/xdotool mousemove %d %d' % (x, y)
                os.system(cmd)
            value_state[value_num] = value
            
        
    # Throttle
    time.sleep(THROTTLE)

Hope it helps someone having the same problem (device)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.