Git Product home page Git Product logo

Comments (7)

matt335672 avatar matt335672 commented on June 23, 2024

Hi @liang16

Could you add a lot more context please. What are you trying to do, and what doesn't work exactly?

from xorgxrdp.

liang16 avatar liang16 commented on June 23, 2024

Hi @matt335672

  1. My pc is Ubuntu 22.04 x64.
  2. Change the primary mouse button on in "setting".
  3. It's work ok on direct desktop, but not work on xrdp.

图片

thinks.

from xorgxrdp.

matt335672 avatar matt335672 commented on June 23, 2024

I've had a good look into this, and it doesn't seem to be possible at the moment.

The main problem is that the xrdp mouse driver doesn't support the libinput "Left Handed Enabled" property. If I use xinput list-props on an evdev device I get this:-

Device 'spice vdagent tablet':
	Device Enabled (124):	1
	Coordinate Transformation Matrix (126):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Natural Scrolling Enabled (264):	0
	libinput Natural Scrolling Enabled Default (265):	0
	libinput Middle Emulation Enabled (266):	0
	libinput Middle Emulation Enabled Default (267):	0
	libinput Calibration Matrix (268):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Calibration Matrix Default (269):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Left Handed Enabled (270):	0
	libinput Left Handed Enabled Default (271):	0
	libinput Send Events Modes Available (247):	1, 0
	libinput Send Events Mode Enabled (248):	0, 0
	libinput Send Events Mode Enabled Default (249):	0, 0
	Device Node (250):	"/dev/input/event4"
	Device Product ID (251):	0, 0
	libinput Drag Lock Buttons (272):	
	libinput Horizontal Scroll Enabled (273):	1
	libinput High Resolution Wheel Scroll Enabled (274):	1

Toggling the GNOME control above changes libinput Left Handed Enabled to 1.

Using get_props on the xrdp mouse driver I get this:-

Device 'xrdpMouse':
	Device Enabled (113):	1
	Coordinate Transformation Matrix (115):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (232):	0
	Device Accel Constant Deceleration (233):	1.000000
	Device Accel Adaptive Deceleration (234):	1.000000
	Device Accel Velocity Scaling (235):	10.000000

I've tried messing about with xinput set-button-map, but I can only set the first two buttons for some reason. Similarly, xmodmap has similar issues.

The same happens with the VNC backend.

The RDP protocol itself has no way to communicate the user's preference from the RDP client that I can find. So I don't think a solution at the xrdp level is right here either.

I'm going to mark this as a 'feature request'. At the moment I can't see the best way to implement this. Anyone have any suggestions?

from xorgxrdp.

matt335672 avatar matt335672 commented on June 23, 2024

As it happens, I've made some progress on this.

The issues I had with xmodmap yesterday aren't explained but they don't happen just after the X server is started. The old way of swapping buttons in the xmodmap manpage seems OK.

Create etc/X11/Xsession.d/90xrdp-gnome-set-handed with the following contents to set the X server handedness at login time from the GNOME setting:-

# -*- sh -*-
# Xsession.d script to set handedness for a GNOME XRDP session mouse
#
# This file is sourced by Xsession(5), not executed.

if [ -n "$XRDP_SESSION" ]; then
    case "`/usr/bin/dconf read \
           /org/gnome/desktop/peripherals/mouse/left-handed`" in
        true)   /usr/bin/xmodmap -e "pointer = 3 2 1" ;;
        *)      /usr/bin/xmodmap -e "pointer = 1 2 3"
    esac
fi

The required utilities are installed with sudo apt install dconf-cli x11-server-utils.

@liang16 - do you want to try this and report back?

In the longer term, we could go down the route of emulating the libinput-specific device parameters for the xorgxrdp driver. These are text strings defined by the xorg-xf86-input-libinput driver in include/libinput-properties.h. This might work - I haven't tried it yet. Disadvantage of this technique is it only works for the xorgxrdp backend.

from xorgxrdp.

matt335672 avatar matt335672 commented on June 23, 2024

@liang16 - did you manage to try this?

from xorgxrdp.

BruceJL avatar BruceJL commented on June 23, 2024

@matt335672 I've tested your above config and it works correctly, with the expected caveat that a full log-off/log-on is required to toggle the setting.

FWIW The x11-server-utils package was not found on my instance of debian stable.

from xorgxrdp.

matt335672 avatar matt335672 commented on June 23, 2024

Thanks for reporting back @BruceJL

The missing package looks like it's called x11-xserver-utils in Bullseye. My mistake!

I'll move this to a feature request on xorgxrdp.

from xorgxrdp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.