A small Python package for rotating the screen.
Project description
Rotate Screen
A small Python package for rotating the screen.
Platforms Supported
Windows is currently the only platform supported.
Installation
Clone the repo or download as zip then navigate to the project root directory and use the following command...
pip install rotate-screen
Example:
This is a simple example that implements the 'Ctrl+Alt+Arrow' shortcut for rotating the display. Some graphics cards don't come with this capability by default.
This example requires the keyboard module...
pip install keyboard
Here is the code! This module adds hotkeys to rotate the main display to the corresponding arrow keys.
import rotatescreen
import keyboard
screen = rotatescreen.get_primary_display()
keyboard.add_hotkey('ctrl+alt+up', screen.set_landscape, suppress=True)
keyboard.add_hotkey('ctrl+alt+right', screen.set_portrait_flipped, suppress=True)
keyboard.add_hotkey('ctrl+alt+down', screen.set_landscape_flipped, suppress=True)
keyboard.add_hotkey('ctrl+alt+left', screen.set_portrait, suppress=True)
keyboard.wait()
Example:
This was a little joke script to show off some more of the modules functionality, due to the way windows rotates the display this is a pretty horrific looking, but entertaining. :)
import rotatescreen
import time
screen = rotatescreen.get_primary_display()
start_pos = screen.current_orientation
for i in range(1, 5):
pos = abs((start_pos - i*90) % 360)
screen.rotate_to(pos)
time.sleep(1.5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rotate_screen-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a11c1cef48936f8417a2eb9b9ea6d02c8d3c2ad9bcb984431432633623093ced |
|
MD5 | 4a1ba9a0477e2341eb31fa2c068ec5a0 |
|
BLAKE2b-256 | dcabe4949d14cfb1ea6927f283b1562b6f4e07089d08a2e060a5a66c56f5d098 |