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 represtnation of the keys.
To list all avaiable 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.1.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.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_input-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5e096a4d4136b236c9f5aa271e093ba28d905dc4d94d04e587652fd64ef416ae
MD5 b6765944add5f77d12c753a4eb096cf0
BLAKE2b-256 3f010843aa3faec0c1b26c18a94f1ecb457cdbd7f344b09114fd427b9e4749b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_input-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a2ae4bc9fc3195a87ef03b401e79de21996c583f997c4143ce79ab174864332
MD5 e44f482eea093fb41118a0723ae65066
BLAKE2b-256 a32cb6c9520903bbc10a3e5dc7fc8e0eb7cb68671b013eaf4a491329558810a1

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