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

Add shortcut to rotate screen #11

Closed
MCMic opened this issue Mar 9, 2018 · 13 comments
Closed

Add shortcut to rotate screen #11

MCMic opened this issue Mar 9, 2018 · 13 comments

Comments

@MCMic
Copy link

MCMic commented Mar 9, 2018

When I go back to home screen the phone goes back to portrait mode and then after starting an app I have to manually lean the phone to rotate the screen, it would be easier if there was a shorcut which rotates the screen.

@npes87184
Copy link
Contributor

Reference #218

@rom1v
Copy link
Collaborator

rom1v commented Oct 2, 2018

As a workaround:

# disable auto rotation
adb shell settings put system accelerometer_rotation 0
# use custom rotation (0=portrait, 1=landscape)
adb shell settings put system user_rotation 1

#284 (comment)

@rom1v rom1v added the rotation label Oct 2, 2018
@ChristopherKrohn
Copy link

Is there a way to put the monitor in landscape while the camera is showing?
I tried the above commands both while scrcpy was active in terminal, and when it was not, and nothing happened when I executed the commands.

Am I missing something, or is the monitor simply not willing to be in landscape while the camera app is open?

@rom1v
Copy link
Collaborator

rom1v commented Mar 21, 2019

Some camera apps keep the device in landscape mode (and rotate their icons manually when the device is rotated). This avoids a glitch due to the portrait/landscape switch.

The "solution" is to implement a (manual) client-side rotation in scrcpy.

@ChristopherKrohn
Copy link

Aha, that makes sense! Thanks for the fast response!

Is there a simple way of implementing this, or is this something I should just leave be?
I'm just wondering if it is possible to rotate the mirror shown on my desktop some way.

I have absolutely no experience with this though.

@rom1v
Copy link
Collaborator

rom1v commented Mar 21, 2019

It is probably not very difficult, but it is quite intrusive (we need to check everywhere the current rotation to reverse width and height).

It's in my (virtual) todo list when I have time (maybe after the "device screen off" while mirroring).

@ChristopherKrohn
Copy link

Alright! Thanks!

In the meantime I'll just use another app that rotates with the screen.
Open Camera worked really well, for other users having the same issue.

Thanks again!

@agsola
Copy link

agsola commented Sep 4, 2019

This would be great to be implemented in next release.

Appart from this it has everything needed to work daily with it.

@srevinsaju
Copy link

srevinsaju commented Sep 4, 2019 via email

@hunterx9
Copy link

i added shortcut key for screen rotation
here's the code:
https://files.catbox.moe/c8lz87.c
Place input_manager.c inside project-> app--src folder and build it using
ninja -Cx
./run x

Ctrl+q = Change screen density to 200
Ctrl+w = Reset screen density
Ctrl+e = landscape mode
Ctrl+r = portrait mode

try this first in adb if rotation doesnt work
adb shell settings put system accelerometer_rotation 0

rom1v added a commit that referenced this issue Dec 4, 2019
On Ctrl+r, disable auto-rotation (if enabled), set the screen rotation
and re-enable auto-rotation (if it was enabled).

Closes #11 <#11>
@rom1v
Copy link
Collaborator

rom1v commented Dec 4, 2019

I just implemented it on branch rotatedevice (eb0f339).

Just press Ctrl+r (or Cmd+r on macOS) to rotate the device.

Feedbacks welcome :)

@r4dixx
Copy link

r4dixx commented Dec 5, 2019

Tested on Pixel 2 and Pixel 4 - Android 10, from macOS Catalina.
Works perfectly! Thanks

@rom1v
Copy link
Collaborator

rom1v commented Dec 5, 2019

Merged in dev.

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

No branches or pull requests

8 participants