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 simple the 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.0.tar.gz (2.0 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.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_input-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 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.0.tar.gz
Algorithm Hash digest
SHA256 9ed22bde41b30be8993c20b46c5956a3643cfa9aa9c378b721226e6552aad91a
MD5 55aa0edbfb83b9c6544f9f44cf7cbf3e
BLAKE2b-256 ce1475a107483bbe72758d447e0cbecee0d71ca6c9cc569090aac27145fbf867

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_input-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fff6007ec135201a8074e641f8ae1b4d915facea82e04612b995cd624cf4bcc1
MD5 9e513ee05fd6be83f049ea5461c673c8
BLAKE2b-256 b86b6c24818173926ef60addd8e36490a287b6a5d9546cb19fc9bd028a1740f3

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