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.

Source Distribution

rotate-screen-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rotate_screen-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file rotate-screen-0.1.0.tar.gz.

File metadata

  • Download URL: rotate-screen-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for rotate-screen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 117a5abcb738d9bb59f858d847ff854e362b2c6cddca0e7c438c1074fc7fb8ef
MD5 0564eb7e5dccba941b143eaea4278803
BLAKE2b-256 64a38e997e756f817204c1b698dd3d739e2152aeb9f6779e180d553e98baec18

See more details on using hashes here.

File details

Details for the file rotate_screen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rotate_screen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for rotate_screen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a11c1cef48936f8417a2eb9b9ea6d02c8d3c2ad9bcb984431432633623093ced
MD5 4a1ba9a0477e2341eb31fa2c068ec5a0
BLAKE2b-256 dcabe4949d14cfb1ea6927f283b1562b6f4e07089d08a2e060a5a66c56f5d098

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page