SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

 
 

python3-pynput rpm build for : OpenSuSE. For other distributions click python3-pynput.

Name : python3-pynput
Version : 1.4.2 Vendor : obs://build_opensuse_org/home:lrupp
Release : lp156.1.1 Date : 2024-02-12 10:49:12
Group : Development/Languages/Python Source RPM : python-pynput-1.4.2-lp156.1.1.src.rpm
Size : 0.57 MB
Packager : https://www_suse_com/
Summary : Monitor and control user input devices
Description :
pynput
======

This library allows you to control and monitor input devices.

Currently, mouse and keyboard input and monitoring are supported.

See `here < https://pynput.readthedocs.io/en/latest/>`_ for the full
documentation.


Controlling the mouse
---------------------

Use ``pynput.mouse.Controller`` like this::

from pynput.mouse import Button, Controller

mouse = Controller()


print(\'The current pointer position is {0}\'.format(
mouse.position))


mouse.position = (10, 20)
print(\'Now we have moved it to {0}\'.format(
mouse.position))


mouse.move(5, -5)


mouse.press(Button.left)
mouse.release(Button.left)



mouse.click(Button.left, 2)


mouse.scroll(0, 2)


Monitoring the mouse
--------------------

Use ``pynput.mouse.Listener`` like this::

from pynput import mouse

def on_move(x, y):
print(\'Pointer moved to {0}\'.format(
(x, y)))

def on_click(x, y, button, pressed):
print(\'{0} at {1}\'.format(
\'Pressed\' if pressed else \'Released\',
(x, y)))
if not pressed:

return False

def on_scroll(x, y, dx, dy):
print(\'Scrolled {0} at {1}\'.format(
\'down\' if dy < 0 else \'up\',
(x, y)))


with mouse.Listener(
on_move=on_move,
on_click=on_click,
on_scroll=on_scroll) as listener:
listener.join()


listener = mouse.Listener(
on_move=on_move,
on_click=on_click,
on_scroll=on_scroll)
listener.start()

A mouse listener is a ``threading.Thread``, and all callbacks will be invoked
from the thread.

Call ``pynput.mouse.Listener.stop`` from anywhere, raise ``StopException`` or
return ``False`` from a callback to stop the listener.


The mouse listener thread
~~~~~~~~~~~~~~~~~~~~~~~~~

The listener callbacks are invoked directly from an operating thread on some
platforms, notably *Windows*.

This means that long running procedures and blocking operations should not be
invoked from the callback, as this risks freezing input for all processes.

A possible workaround is to just dispatch incoming messages to a queue, and let
a separate thread handle them.


Handling mouse listener errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If a callback handler raises an exception, the listener will be stopped. Since
callbacks run in a dedicated thread, the exceptions will not automatically be
reraised.

To be notified about callback errors, call ``Thread.join`` on the listener
instance::

from pynput import mouse

class MyException(Exception): pass

def on_click(x, y, button, pressed):
if button == mouse.Button.left:
raise MyException(button)


with mouse.Listener(
on_click=on_click) as listener:
try:
listener.join()
except MyException as e:
print(\'{0} was clicked\'.format(e.args[0]))


Controlling the keyboard
------------------------

Use ``pynput.keyboard.Controller`` like this::

from pynput.keyboard import Key, Controller

keyboard = Controller()


keyboard.press(Key.space)
keyboard.release(Key.space)



keyboard.press(\'a\')
keyboard.release(\'a\')


keyboard.press(\'A\')
keyboard.release(\'A\')
with keyboard.pressed(Key.shift):
keyboard.press(\'a\')
keyboard.release(\'a\')


keyboard.type(\'Hello World\')


Monitoring the keyboard
-----------------------

Use ``pynput.keyboard.Listener`` like this::

from pynput import keyboard

def on_press(key):
try:
print(\'alphanumeric key {0} pressed\'.format(
key.char))
except AttributeError:
print(\'special key {0} pressed\'.format(
key))

def on_release(key):
print(\'{0} released\'.format(
key))
if key == keyboard.Key.esc:

return False


with keyboard.Listener(
on_press=on_press,
on_release=on_release) as listener:
listener.join()


listener = mouse.Listener(
on_press=on_press,
on_release=on_release)
listener.start()

A keyboard listener is a ``threading.Thread``, and all callbacks will be
invoked from the thread.

Call ``pynput.keyboard.Listener.stop`` from anywhere, raise ``StopException``
or return ``False`` from a callback to stop the listener.

The ``key`` parameter passed to callbacks is a ``pynput.keyboard.Key``, for
special keys, a ``pynput.keyboard.KeyCode`` for normal alphanumeric keys, or
just ``None`` for unknown keys.


The keyboard listener thread
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The listener callbacks are invoked directly from an operating thread on some
platforms, notably *Windows*.

This means that long running procedures and blocking operations should not be
invoked from the callback, as this risks freezing input for all processes.

A possible workaround is to just dispatch incoming messages to a queue, and let
a separate thread handle them.


Handling keyboard listener errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If a callback handler raises an exception, the listener will be stopped. Since
callbacks run in a dedicated thread, the exceptions will not automatically be
reraised.

To be notified about callback errors, call ``Thread.join`` on the listener
instance::

from pynput import keyboard

class MyException(Exception): pass

def on_press(key):
if key == keyboard.Key.esc:
raise MyException(key)


with keyboard.Listener(
on_press=on_press) as listener:
try:
listener.join()
except MyException as e:
print(\'{0} was pressed\'.format(e.args[0]))

RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/home:/lrupp/15.6/noarch

Content of RPM  Changelog  Provides Requires

Download
ftp.icm.edu.pl  python3-pynput-1.4.2-lp156.1.1.noarch.rpm
     

Provides :
python3-pynput

Requires :
python(abi) = 3.6
python3-six
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1


Content of RPM :
/usr/lib/python3.6/site-packages/pynput
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info/PKG-INFO
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info/SOURCES.txt
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info/dependency_links.txt
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info/pbr.json
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info/requires.txt
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info/top_level.txt
/usr/lib/python3.6/site-packages/pynput-1.4.2-py3.6.egg-info/zip-safe
/usr/lib/python3.6/site-packages/pynput/__init__.py
/usr/lib/python3.6/site-packages/pynput/__pycache__
/usr/lib/python3.6/site-packages/pynput/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pynput/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/pynput/__pycache__/_info.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pynput/__pycache__/_info.cpython-36.pyc
/usr/lib/python3.6/site-packages/pynput/_info.py
/usr/lib/python3.6/site-packages/pynput/_util
/usr/lib/python3.6/site-packages/pynput/_util/__init__.py
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/darwin.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/darwin.cpython-36.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/win32.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/win32.cpython-36.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/win32_vks.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/win32_vks.cpython-36.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/xorg.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/xorg.cpython-36.pyc
/usr/lib/python3.6/site-packages/pynput/_util/__pycache__/xorg_keysyms.cpython-36.opt-1.pyc
There is 42 files more in these RPM.

 
ICM