Skip to main content

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: Ctrl+Alt+Arrow Shortcut

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: Do A Barrel Roll

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rotate-screen, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size rotate_screen-0.1.0-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size rotate-screen-0.1.0.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page