Skip to main content

Code like a god on-the-fly

Project description

onthefly

https://img.shields.io/pypi/v/onthefly.svg

onthefly allows you to emulate typing the contents of an input file by wildly pressing the asdf jkl; keys of your keyboard. Great for live coding presentations.

<a href=”https://asciinema.org/a/1O1h6bm4KiQcYVCSduQtGIohD” target=”_blank”><img src=”https://asciinema.org/a/1O1h6bm4KiQcYVCSduQtGIohD.svg” width=”835”/></a>

Features

  • Unicode support

  • Works with any text editor

Installation

Install and update at system level using pip:

$ sudo python -m pip install onthefly

Usage

Identify your keyboard with evtest:

$ sudo python -m evdev.evtest

ID  Device               Name                                 ...
------------------------------------------------------------- ...
0   /dev/input/event0    Lid Switch                           ...
1   /dev/input/event1    Power Button                         ...
2   /dev/input/event2    Sleep Button                         ...
3   /dev/input/event3    Power Button                         ...
4   /dev/input/event4    AT Translated Set 2 keyboard         ...
5   /dev/input/event5    Video Bus                            ...
6   /dev/input/event6    Logitech M215 2nd Gen                ...
7   /dev/input/event7    Logitech K330                        ...
8   /dev/input/event8    SynPS/2 Synaptics TouchPad           ...
.
.
.

From this output, we see that my keyboard is identified with the name Logitech K330.

Pass the name of your keyboard as an argument to the keyboard option when invoking onthefly for the first time.

$ sudo onthefly --keyboard="Logitech K330" /path/to/file

Note that onthefly needs to be run with sudo privileges in order to have access to the keyboard events:

The keyboard name is remembered so you do not have to re-enter it in future invokations:

$ sudo onthefly /path/to/file

Type the Pause/Break key to quit the program at any moment. Supports using the Backspace key to erase characters without going out of sync with respect to the input file.

License

  • Free software: MIT license

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.3.0 (2020-05-19)

  • First release on PyPI.

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

onthefly-1.0.4.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

onthefly-1.0.4-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file onthefly-1.0.4.tar.gz.

File metadata

  • Download URL: onthefly-1.0.4.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for onthefly-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7b1a3d911b575309cd6e1de97bde745d24ccb49d7c1849edae7a60fa5d819bb1
MD5 a134da07c819360a46bd6c3c3c692886
BLAKE2b-256 bfee04ad7bd6fbb54e6363a40b36b0855fa6842577169ce90fbaec1b78d61353

See more details on using hashes here.

File details

Details for the file onthefly-1.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: onthefly-1.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for onthefly-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8be818cb82ff7457bcbef6e49deca8d4d0a77856d78d89ff8cb712091735f5c5
MD5 6d8986dd48fe1d8bf9c148b53f588274
BLAKE2b-256 94dd4044b4f6227f323f84d5c7ef72257370e3684e8357057b457110d9855646

See more details on using hashes here.

Supported by

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