========
onthefly
========

.. image:: https://img.shields.io/pypi/v/onthefly.svg
        :target: https://pypi.python.org/pypi/onthefly

onthefly allows you to emulate typing the contents of an input file by wildly pressing the *asdf jkl;* keys of your keyboard.


Features
--------

* Unicode support


Installation
------------

Install and update using pip:

.. code-block:: text

    $ sudo python -m pip install onthefly


Usage
-----

Identify your keyboard with `evtest`:

.. code-block:: text

    $ sudo python -m evdev.evtest

    ID  Device               Name                                Phys                                Uniq
    -----------------------------------------------------------------------------------------------------------------
    0   /dev/input/event0    Lid Switch                          PNP0C0D/button/input0
    1   /dev/input/event1    Power Button                        PNP0C0C/button/input0
    2   /dev/input/event2    Sleep Button                        PNP0C0E/button/input0
    3   /dev/input/event3    Power Button                        LNXPWRBN/button/input0
    4   /dev/input/event4    AT Translated Set 2 keyboard        isa0060/serio0/input0
    5   /dev/input/event5    Video Bus                           LNXVIDEO/video/input0
    6   /dev/input/event6    Logitech M215 2nd Gen               usb-0000:00:14.0-2:1                401b-62-7e-d5-a3
    7   /dev/input/event7    Logitech K330                       usb-0000:00:14.0-2:2                4016-68-4c-af-ee
    8   /dev/input/event8    SynPS/2 Synaptics TouchPad          isa0060/serio1/input0
    .
    .
    .

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.

.. code-block:: text

   $ 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:

.. code-block:: text

   $ sudo onthefly /path/to/file


License
-------

* Free software: MIT license


Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
