Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Rotate input #3840

Closed
FunctionalHacker opened this issue Mar 9, 2019 · 7 comments
Closed

[Feature Request] Rotate input #3840

FunctionalHacker opened this issue Mar 9, 2019 · 7 comments

Comments

@FunctionalHacker
Copy link

FunctionalHacker commented Mar 9, 2019

I have a 2-in-1 laptop and sometimes I like to rotate the screen 90 degrees and read PDF's and the like. Back in X, I used to be able to do this: xrandr --output eDP --rotate right && xinput set-prop "ELAN Touchscreen" --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1

I can do the first part of the command, the rotating of the screen in Sway, but the second part, which is rotating the input of the touch screen I did not find in the documentation, so I think this is not implement yet.

@emersion
Copy link
Member

emersion commented Mar 9, 2019

Can you try mapping the touch screen to the output?

@FunctionalHacker
Copy link
Author

How does one do that? Sorry, I'm very new to Sway

@emersion
Copy link
Member

emersion commented Mar 9, 2019

You can have a look at the manpage: man 5 sway-input. Grep for "map". ;)

@FunctionalHacker
Copy link
Author

That worked a treat! Thank you very much and sorry for wasting your time. I will check the man pages more thoroughly next time 😄

@mb720
Copy link

mb720 commented Mar 25, 2020

Thanks for the hint, @emersion! 👍

This worked for me:

swaymsg input <my-touch-screen> map_to_output <my-monitor>

To get input and output devices, I did swaymsg -t get_inputs and swaymsg -t get_outputs respectively.

On my Lenovo X220 tablet, this ended up being

swaymsg input 1386:230:Wacom_ISDv4_E6_Pen map_to_output LVDS-1

After that, I flipped the screen using

swaymsg output LVDS-1 transform 180

and positioning the cursor on the screen with a finger or the stylus worked flawlessly.

@fidelsalz
Copy link

Thanks @emersion for the hint and @mb720 for giving exact commands, they worked perfect.
Just to comment that mouses (and maybe pointers) remap automatically after screen rotation.

@bennypowers
Copy link

I have this config file

# Read `man 5 sway` for a complete reference.

set $logo Mod4
set $alt Mod1

output HDMI-A-1 {
	resolution 1024x600
	bg ~/rvs.jpg fill #000000
}

input "6790:58851:TeNizo_TeNizo_R7Series_TC" {
	map_to_output HDMI-A-1
}

output HDMI-A-1 transform 90

bindsym $logo+Return exec foot
bindsym $logo+Shift+q kill
bindsym $logo+Shift+c reload
bindsym $logo+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'

the touchscreen is a cheapo 7in hdmi module from ali. input is flipped both horizontally and vertically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants