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.4.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.4-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_input-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 32fea6794bb118332c430042d1e90469cebb02832165e110f73a7ea0c49f622e
MD5 6a0aa9b2c26badbb175ed05c03bee363
BLAKE2b-256 63d0460ec0f30d7106ba5ef645aded0046d0aa9390b188cced824de3b8c87892

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_input-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7c239ba84277917cc3cb4ab18890e288309f96493a24359d6b5aa61dd3104af5
MD5 5ad416db14349c316f505bb643ad96aa
BLAKE2b-256 6a76875fa6f527f17204c923ea7118d2511411092f559dae1603150b681981bc

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