You are not logged in.

#1 2014-10-06 15:47:22

DelusionalLogic
Member
Registered: 2013-05-07
Posts: 40

EmulateThirdButton not working.

I'm running arch on a tablet. I've gotten everything to work, except evdev. The default input (touch somewhere to click there) works, but the required EmulateThirdButton isn't.

This is my xorg.conf:

Section "Device"
        Identifier      "Video Device"
        Driver          "freedreno"
        # Uncomment for addition debug traces in xorg log:
        Option          "Debug"           "true"
        # The below two options are not needed if you are using the
        # msm drm/kms driver:
        Option          "fb"              "/dev/fb0"
        Option           "SWCursor"        "true"
        Option           "SWRefresher"        "false"
        Option           "NoAccel"     "true"
EndSection
Section "Screen"
        Identifier      "Screen"
        Monitor         "Monitor"
        Device          "Video Device"
EndSection
Section "InputClass"
        Identifier "rightclick"
        Driver "evdev"
        MatchIsTouchscreen "on"
#       MatchProduct "eGalax INC. USB TouchController"
#       Option "Calibration" "50 4000 130 3900"
        Option "EmulateThirdButton" "on"
        Option "EmulateThirdButtonTimeout" "750"
        Option "EmulateThirdButtonMoveThreshold" "300"
EndSection

Running startx it produces the following log:

[   158.006]                                                                                                                                                                                                                 
X.Org X Server 1.16.1                                                                                                                                                                                                        
Release Date: 2014-09-21                                                                                                                                                                                                     
[   158.006] X Protocol Version 11, Revision 0                                                                                                                                                                               
[   158.006] Build Operating System: Linux 3.4.76-1-ARCH armv7l                                                                                                                                                              
[   158.006] Current Operating System: Linux delusionalNex 3.4.0-ARCH #3 SMP PREEMPT Mon Oct 6 01:21:27 CEST 2014 armv7l                                                                                                     
[   158.006] Kernel command line: g_serial.n_ports=2 console=tty1 fbcon=rotate:1 androidboot.hardware=flo user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 selinux=0 fsck.mode=skip androidboot.emmc=true androidboot.serial
no=059a3678 bootreason=Reboot fuse_info=Y androidboot.baseband=apq asustek.hw_rev=rev_e androidboot.bootloader=FLO-03.05                                                                                                     
[   158.007] Build Date: 23 September 2014  10:08:38AM                                                                                                                                                                       
[   158.007]                                                                                                                                                                                                                 
[   158.007] Current version of pixman: 0.32.6                                                                                                                                                                               
[   158.007]    Before reporting problems, check http://wiki.x.org                                                                                                                                                           
        to make sure that you have the latest version.                                                                                                                                                                       
[   158.007] Markers: (--) probed, (**) from config file, (==) default setting,                                                                                                                                              
        (++) from command line, (!!) notice, (II) informational,                                                                                                                                                             
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.                                                                                                                                                        
[   158.008] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Oct  6 15:36:08 2014
[   158.009] (==) Using config file: "/etc/X11/xorg.conf"
[   158.009] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   158.010] (==) No Layout section.  Using the first Screen section.
[   158.010] (**) |-->Screen "Screen" (0)
[   158.010] (**) |   |-->Monitor "<default monitor>"
[   158.010] (**) |   |-->Device "Video Device"
[   158.011] (==) No monitor specified for screen "Screen".
        Using a default monitor configuration.
[   158.011] (==) Automatically adding devices
[   158.011] (==) Automatically enabling devices
[   158.011] (==) Automatically adding GPU devices
[   158.011] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
[   158.011]    Entry deleted from font path.
[   158.011] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[   158.011]    Entry deleted from font path.
[   158.011] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[   158.011]    Entry deleted from font path.
[   158.011]    (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
[   158.011] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[   158.011]    Entry deleted from font path.
[   158.011]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
[   158.011] (==) FontPath set to:
        /usr/share/fonts/misc/,
        /usr/share/fonts/TTF/
[   158.012] (==) ModulePath set to "/usr/lib/xorg/modules"
[   158.012] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[   158.012] (II) Loader magic: 0x1cdef0
[   158.012] (II) Module ABI versions:
[   158.012]    X.Org ANSI C Emulation: 0.4
[   158.012]    X.Org Video Driver: 18.0
[   158.012]    X.Org XInput driver : 21.0
[   158.012]    X.Org Server Extension : 8.0
[   158.017] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31
[   158.018] (II) xfree86: Adding drm device (/dev/dri/card0)
[   158.019] (EE) systemd-logind: failed to take device /dev/dri/card0: Operation not permitted
[   158.020] (II) no primary bus or device found
[   158.020]    falling back to /sys/devices/platform/kgsl-3d0.0/drm/card0
[   158.020] (II) LoadModule: "glx"
[   158.021] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   158.034] (II) Module glx: vendor="X.Org Foundation"
[   158.034]    compiled for 1.16.1, module version = 1.0.0
[   158.035]    ABI class: X.Org Server Extension, version 8.0
[   158.035] (==) AIGLX enabled
[   158.035] (II) LoadModule: "freedreno"
[   158.035] (II) Loading /usr/lib/xorg/modules/drivers/freedreno_drv.so
[   158.036] (II) Module freedreno: vendor="X.Org Foundation"
[   158.036]    compiled for 1.16.1, module version = 1.3.0
[   158.036]    ABI class: X.Org Video Driver, version 18.0
[   158.036] (II) freedreno: Video driver for Qualcomm processors
[   158.049] (--) using VT number 2

[   158.289] (WW) Falling back to old probe method for freedreno
[   158.405] (II) No msm DRM/KMS, fallback to fbdev/kgsl
[   158.405] (II) Section 0 - looking for /dev/fb0
[   158.421] (II) freedreno(0): MSMPreInit:183 pre-init
[   158.421] (--) freedreno(0): Depth 0, (--) framebuffer bpp 0
[   158.421] (II) freedreno(0): MSM/Qualcomm processor
[   158.421] drmOpenDevice: node name is /dev/dri/card0
[   158.421] drmOpenDevice: open result is 9, (OK)
[   158.422] drmOpenDevice: node name is /dev/dri/card0
[   158.422] drmOpenDevice: open result is 9, (OK)
[   158.422] drmOpenDevice: node name is /dev/dri/card1
[   158.429] drmOpenDevice: node name is /dev/dri/card2
[   158.437] drmOpenDevice: node name is /dev/dri/card3
[   158.445] drmOpenDevice: node name is /dev/dri/card4
[   158.452] drmOpenDevice: node name is /dev/dri/card5
[   158.460] drmOpenDevice: node name is /dev/dri/card6
[   158.468] drmOpenDevice: node name is /dev/dri/card7
[   158.475] drmOpenDevice: node name is /dev/dri/card8
[   158.483] drmOpenDevice: node name is /dev/dri/card9
[   158.491] drmOpenDevice: node name is /dev/dri/card10
[   158.499] drmOpenDevice: node name is /dev/dri/card11
[   158.506] drmOpenDevice: node name is /dev/dri/card12
[   158.514] drmOpenDevice: node name is /dev/dri/card13
[   158.522] drmOpenDevice: node name is /dev/dri/card14
[   158.529] drmOpenDevice: node name is /dev/dri/card15
[   158.538] drmOpenDevice: node name is /dev/dri/card0
[   158.538] drmOpenDevice: open result is 9, (OK)
[   158.538] drmOpenDevice: node name is /dev/dri/card0
[   158.538] drmOpenDevice: open result is 9, (OK)
[   158.538] drmGetBusid returned ''
[   158.556] (WW) freedreno(0): WARNING: Unable to determine the MDP version - assume 3.1
[   158.589] (II) freedreno(0): Creating default Display subsection in Screen section
        "Screen" for depth/fbbpp 24/32
[   158.589] (II) freedreno(0): Output default has no monitor section
[   158.589] (II) freedreno(0): Printing probed modes for output default
[   158.590] (II) freedreno(0): Modeline "1200x1920"x60.0  155.49  1200 1248 1280 1340  1920 1923 1928 1934 (116.0 kHz Pb)
[   158.590] (II) freedreno(0): Output default connected
[   158.590] (II) freedreno(0): Using exact sizes for initial modes
[   158.590] (II) freedreno(0): Output default using initial mode 1200x1920
[   158.590] (II) freedreno(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
[   158.590] (**) freedreno(0): Option "fb" "/dev/fb0"
[   158.590] (**) freedreno(0): Option "NoAccel" "true"
[   158.590] (**) freedreno(0): Option "SWCursor" "true"
[   158.590] (**) freedreno(0): Option "SWRefresher" "false"
[   158.590] (**) freedreno(0): Option "Debug" "true"
[   158.590] (II) freedreno(0): Option Summary:
[   158.590] (II) freedreno(0):   NoAccel:     1
[   158.591] (II) freedreno(0):   HWCursor:    0
[   158.591] (II) freedreno(0):   examask:     7
[   158.591] (II) freedreno(0):   fb:          /dev/fb0
[   158.591] (II) freedreno(0):   SWRefresher: 0
[   158.591] (II) freedreno(0):   Debug:       1
[   158.591] (--) freedreno(0): Virtual size is 1200x1920 (pitch 1216)
[   158.591] (**) freedreno(0):  Built-in mode "1200x1920": 155.5 MHz (scaled from 0.0 MHz), 116.0 kHz, 60.0 Hz
[   158.591] (II) freedreno(0): Modeline "1200x1920"x0.0  155.49  1200 1248 1280 1340  1920 1923 1928 1934 (116.0 kHz Pb)
[   158.591] (==) freedreno(0): DPI set to (96, 96)
[   158.591] (==) freedreno(0): RGB weight 888
[   158.591] (==) freedreno(0): Default visual is TrueColor
[   158.591] (II) freedreno(0): MSM Options:
[   158.591] (II) freedreno(0):  HW Cursor: Disabled
[   158.591] (==) Depth 24 pixmap format is 32 bpp
[   158.591] (II) freedreno(0): MSMScreenInit:395 screen-init
[   158.592] (II) Loading sub module "fb"
[   158.592] (II) LoadModule: "fb"
[   158.592] (II) Loading /usr/lib/xorg/modules/libfb.so
[   158.593] (II) Module fb: vendor="X.Org Foundation"
[   158.593]    compiled for 1.16.1, module version = 1.0.0
[   158.593]    ABI class: X.Org ANSI C Emulation, version 0.4
[   158.594] (==) freedreno(0): Backing store enabled
[   158.594] (II) Loading sub module "exa"
[   158.594] (II) LoadModule: "exa"
[   158.594] (II) Loading /usr/lib/xorg/modules/libexa.so
[   158.595] (II) Module exa: vendor="X.Org Foundation"
[   158.595]    compiled for 1.16.1, module version = 2.6.0
[   158.595]    ABI class: X.Org Video Driver, version 18.0
[   158.595] [E] could not open /dev/kgsl-2d0 device: -1 (No such file or directory) (kgsl_pipe_new:220)
[   158.595] [E] allocation failed (fd_pipe_new:48)
[   158.595] (II) freedreno(0): no 2D pipe, falling back to software!
[   158.600] [I] Pipe Info: (kgsl_pipe_new:249)
[   158.601] [I]  Device:          /dev/kgsl-3d0 (kgsl_pipe_new:250)
[   158.601] [I]  Chip-id:         3.2.0.2 (kgsl_pipe_new:255)
[   158.601] [I]  Device-id:       1 (kgsl_pipe_new:256)
[   158.601] [I]  GPU-id:          320 (kgsl_pipe_new:257)
[   158.601] [I]  MMU enabled:     1 (kgsl_pipe_new:258)
[   158.601] [I]  GMEM Base addr:  0x00000000 (kgsl_pipe_new:259)
[   158.601] [I]  GMEM size:       0x00080000 (kgsl_pipe_new:260)
[   158.601] [I]  Driver version:  3.14 (kgsl_pipe_new:262)
[   158.601] [I]  Device version:  3.1 (kgsl_pipe_new:264)
[   158.601] (II) Loading sub module "exa"
[   158.601] (II) LoadModule: "exa"
[   158.601] (II) Loading /usr/lib/xorg/modules/libexa.so
[   158.602] (II) Module exa: vendor="X.Org Foundation"
[   158.602]    compiled for 1.16.1, module version = 2.6.0
[   158.602]    ABI class: X.Org Video Driver, version 18.0
[   158.602] (II) freedreno(0): MSMSetupExa:1037 soft-exa
[   158.602] (II) EXA(0): Driver allocated offscreen pixmaps
[   158.602] (II) EXA(0): Driver registered support for the following operations:
[   158.602] (II)         Solid
[   158.602] (II)         Copy
[   158.602] (II)         Composite (RENDER acceleration)
[   158.602] (II) freedreno(0): [DRI2] Setup complete
[   158.602] (II) freedreno(0): [DRI2]   DRI driver: kgsl
[   158.603] (II) freedreno(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[   158.608] (--) RandR disabled
[   158.654] (EE) AIGLX error: dlopen of /usr/lib/xorg/modules/dri/kgsl_dri.so failed (/usr/lib/xorg/modules/dri/kgsl_dri.so: cannot open shared object file: No such file or directory)
[   158.654] (EE) AIGLX: reverting to software rendering
[   158.810] (II) AIGLX: Loaded and initialized swrast
[   158.810] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[   158.812] (II) freedreno(0): MSMEnterVT:533 enter-vt
[   158.813] (II) freedreno(0): Setting screen physical size to 317 x 508
[   158.982] (II) config/udev: Adding input device gpio-keys (/dev/input/event5)
[   158.982] (**) gpio-keys: Applying InputClass "evdev keyboard catchall"
[   158.982] (II) LoadModule: "evdev"
[   158.983] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[   158.985] (II) Module evdev: vendor="X.Org Foundation"
[   158.985]    compiled for 1.16.0, module version = 2.9.0
[   158.985]    Module class: X.Org XInput Driver
[   158.985]    ABI class: X.Org XInput driver, version 21.0
[   158.987] (EE) systemd-logind: failed to take device /dev/input/event5: Operation not permitted
[   158.987] (II) Using input driver 'evdev' for 'gpio-keys'
[   158.987] (**) gpio-keys: always reports core events
[   158.987] (**) evdev: gpio-keys: Device: "/dev/input/event5"
[   158.987] (--) evdev: gpio-keys: Vendor 0x1 Product 0x1
[   158.987] (--) evdev: gpio-keys: Found keys
[   158.987] (II) evdev: gpio-keys: Configuring as keyboard
[   158.988] (**) Option "config_info" "udev:/sys/devices/platform/gpio-keys.0/input/input5/event5"
[   158.988] (II) XINPUT: Adding extended input device "gpio-keys" (type: KEYBOARD, id 6)
[   158.988] (**) Option "xkb_rules" "evdev"
[   158.988] (**) Option "xkb_model" "pc104"
[   158.988] (**) Option "xkb_layout" "us"
[   159.078] (II) config/udev: Adding input device apq8064-tabla-snd-card Button Jack (/dev/input/event2)
[   159.078] (II) No input driver specified, ignoring this device.
[   159.078] (II) This device may have been added with another device file.
[   159.079] (II) config/udev: Adding input device apq8064-tabla-snd-card Headset Jack (/dev/input/event3)
[   159.079] (II) No input driver specified, ignoring this device.
[   159.079] (II) This device may have been added with another device file.
[   159.080] (II) config/udev: Adding input device elan-touchscreen (/dev/input/event0)
[   159.081] (**) elan-touchscreen: Applying InputClass "evdev touchscreen catchall"
[   159.081] (**) elan-touchscreen: Applying InputClass "rightclick"
[   159.082] (EE) systemd-logind: failed to take device /dev/input/event0: Operation not permitted
[   159.082] (II) Using input driver 'evdev' for 'elan-touchscreen'
[   159.082] (**) elan-touchscreen: always reports core events
[   159.082] (**) evdev: elan-touchscreen: Device: "/dev/input/event0"
[   159.082] (--) evdev: elan-touchscreen: Vendor 0 Product 0
[   159.083] (--) evdev: elan-touchscreen: Found absolute axes
[   159.083] (--) evdev: elan-touchscreen: Found absolute multitouch axes
[   159.083] (II) evdev: elan-touchscreen: No buttons found, faking one.
[   159.083] (--) evdev: elan-touchscreen: Found x and y absolute axes
[   159.083] (--) evdev: elan-touchscreen: Found absolute touchscreen
[   159.083] (II) evdev: elan-touchscreen: Configuring as touchscreen
[   159.083] (**) Option "EmulateThirdButton" "on"
[   159.083] (**) Option "EmulateThirdButtonTimeout" "750"
[   159.083] (**) Option "EmulateThirdButtonMoveThreshold" "300"
[   159.083] (**) evdev: elan-touchscreen: YAxisMapping: buttons 4 and 5
[   159.083] (**) evdev: elan-touchscreen: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[   159.083] (**) Option "config_info" "udev:/sys/devices/virtual/input/input0/event0"
[   159.084] (II) XINPUT: Adding extended input device "elan-touchscreen" (type: TOUCHSCREEN, id 7)
[   159.084] (II) evdev: elan-touchscreen: initialized for absolute axes.
[   159.084] (**) elan-touchscreen: (accel) keeping acceleration scheme 1
[   159.084] (**) elan-touchscreen: (accel) acceleration profile 0
[   159.085] (**) elan-touchscreen: (accel) acceleration factor: 2.000
[   159.085] (**) elan-touchscreen: (accel) acceleration threshold: 4
[   159.086] (II) config/udev: Adding input device elan-touchscreen (/dev/input/mouse0)
[   159.086] (**) elan-touchscreen: Applying InputClass "rightclick"
[   159.086] (II) Using input driver 'evdev' for 'elan-touchscreen'
[   159.086] (**) elan-touchscreen: always reports core events
[   159.086] (**) evdev: elan-touchscreen: Device: "/dev/input/mouse0"
[   159.086] (EE) evdev: elan-touchscreen: Unable to query fd: Inappropriate ioctl for device
[   159.240] (EE) PreInit returned 2 for "elan-touchscreen"
[   159.240] (II) UnloadModule: "evdev"
[   159.241] (II) config/udev: Adding input device lid_input (/dev/input/event1)
[   159.241] (II) No input driver specified, ignoring this device.
[   159.241] (II) This device may have been added with another device file.
[   159.242] (II) config/udev: Adding input device h2w button (/dev/input/event4)
[   159.242] (**) h2w button: Applying InputClass "evdev keyboard catchall"
[   159.243] (EE) systemd-logind: failed to take device /dev/input/event4: Operation not permitted
[   159.243] (II) Using input driver 'evdev' for 'h2w button'
[   159.243] (**) h2w button: always reports core events
[   159.243] (**) evdev: h2w button: Device: "/dev/input/event4"
[   159.243] (--) evdev: h2w button: Vendor 0 Product 0
[   159.244] (--) evdev: h2w button: Found keys
[   159.244] (II) evdev: h2w button: Configuring as keyboard
[   159.244] (**) Option "config_info" "udev:/sys/devices/virtual/input/input4/event4"
[   159.244] (II) XINPUT: Adding extended input device "h2w button" (type: KEYBOARD, id 8)
[   159.244] (**) Option "xkb_rules" "evdev"
[   159.244] (**) Option "xkb_model" "pc104"
[   159.244] (**) Option "xkb_layout" "us"
[   177.971] (II) evdev: h2w button: Close
[   177.972] (II) UnloadModule: "evdev"
[   177.972] (II) evdev: elan-touchscreen: Close
[   177.972] (II) UnloadModule: "evdev"
[   177.972] (II) evdev: gpio-keys: Close
[   177.972] (II) UnloadModule: "evdev"
[   177.973] (II) freedreno(0): MSMCloseScreen:357 close screen
[   177.974] (II) freedreno(0): MSMLeaveVT:565 leave-vt
[   177.978] (EE) Server terminated successfully (0). Closing log file.

If i check xinput it the required parameters are set on elan-touchscreen (which is my only input device). I've also tried xinput test, and it shows all the motions correctly, but the click is instantaneous (instead of waiting for movement, or right click hold).

Why is the emulation not working?

Last edited by DelusionalLogic (2014-10-06 15:56:14)

Offline

#2 2014-10-07 09:00:27

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: EmulateThirdButton not working.

I am not sure if I can help you but you must first try to identify your problem more specifically. From the man page of evdev, I see:

Option "EmulateThirdButton" "boolean"
              Enable third button emulation. Third button emulation emits a right button event (by default) by pressing
              and  holding the first button. The first button must be held down for the configured timeout and must not
              move more than the configured threshold for the emulation to activate. Otherwise, the first button  event
              is posted as normal. Default: off.  Property: "Evdev Third Button Emulation".

The first thing I would check, is how to "press and hold the first button" (from a system point of view). When you click down  the first button, the system should see a NotifyGrab event, when you release the button a NotifyUngrab event. Is this actually what the system see? Try to disable any configuration files and see the output of evdev. Are you able to generate a NotifyGrab event with no NotifyUngrab?

Offline

#3 2014-10-07 14:02:32

DelusionalLogic
Member
Registered: 2013-05-07
Posts: 40

Re: EmulateThirdButton not working.

I checked out the evdev source. It turns out that the hooks ThirdButtonEmulation are never reached if the driver reports touch events.

Offline

#4 2014-10-07 14:13:41

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: EmulateThirdButton not working.

DelusionalLogic wrote:

I checked out the evdev source. It turns out that the hooks ThirdButtonEmulation are never reached if the driver reports touch events.

Sorry to ask for confirmation. But have you tried after having disabled your config file (so that what xev see is the raw thing seen by the Xorg server). Without configuration files, you should generate a NotifyGrab with no NotifyUngrab unless you "release" the button. Are you able to generate that? What do you see when you touch the screen without removing your finger (I suppose it is the tap and hold behavior)?

Last edited by olive (2014-10-07 14:14:18)

Offline

#5 2014-10-08 08:30:22

DelusionalLogic
Member
Registered: 2013-05-07
Posts: 40

Re: EmulateThirdButton not working.

olive wrote:
DelusionalLogic wrote:

I checked out the evdev source. It turns out that the hooks ThirdButtonEmulation are never reached if the driver reports touch events.

Sorry to ask for confirmation. But have you tried after having disabled your config file (so that what xev see is the raw thing seen by the Xorg server). Without configuration files, you should generate a NotifyGrab with no NotifyUngrab unless you "release" the button. Are you able to generate that? What do you see when you touch the screen without removing your finger (I suppose it is the tap and hold behavior)?

If i press down on the screen and hold it i see that the button is pressed, and not released until i remove my finger. everything seems to pass through evdev fine, it just seems like the ThirdButton is looking for the right thing.

Offline

Board footer

Powered by FluxBB