Skip to main content

No project description provided

Project description

Python-Input

Simple mouse and keyboard input for python.

Usage

from python_input import Input, MouseButton

inp = Input()

while(not inp.get_key("q")):
    #Keyboard
    if inp.get_key("space"):
        print("Space pressed!")
    elif(inp.get_key_down("a")):
        print("A down")
    elif(inp.get_key_up("d")):
        print("D up")
    
    #Mouse
    if(inp.get_mouse(MouseButton.left)):
        print("Left pressed")
    elif(inp.get_mouse_down(MouseButton.middle)):
        print("Middle down")
    elif(inp.get_mouse_up(MouseButton.right)):
        print("Right up")

Keys

Keys are the simple string representation of the keys.
To list all available keyboard key strings use print_available_keys

from python_input import Input, MouseButton

inp = Input()
inp.print_available_keys()

Installing from source

poetry init
poetry build
pip install dist/python_input-<VERSION>.tar.gz

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

python_input-0.1.5.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

python_input-0.1.5-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file python_input-0.1.5.tar.gz.

File metadata

  • Download URL: python_input-0.1.5.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.8.10 Linux/5.15.0-86-generic

File hashes

Hashes for python_input-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b8cfeb6da80a9a8043fc6545a65bd2920c6f230e4408c1dd732300e4d8f82731
MD5 6959452c4ef1af7bca008660e7a184ed
BLAKE2b-256 e173136d67958405777c09bb4d0b24a0a1b230b818ab11fa12cc918b7aa0e6eb

See more details on using hashes here.

File details

Details for the file python_input-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: python_input-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.8.10 Linux/5.15.0-86-generic

File hashes

Hashes for python_input-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 63352542d09b4cd2d943eb478f8e5d5208c868d011299319376983ced286ade7
MD5 4a12a5588b8dd7464718427ca8688b30
BLAKE2b-256 8c5c5ec86327d52f69ffa9b7647944c4e1b13d7f4e39d17201388b582d73b614

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