Esempio n. 1
0
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
The module containing keyboard classes.

See the documentation for more information.
"""

# pylint: disable=C0103
# KeyCode, Key, Controller and Listener are not constants

import itertools

from pynput._util import backend, Events

backend = backend(__name__)
KeyCode = backend.KeyCode
Key = backend.Key
Controller = backend.Controller
Listener = backend.Listener
del backend

# pylint: disable=C0326; it is easier to read column aligned keys
#: The keys used as modifiers; the first value in each tuple is the
#: base modifier to use for subsequent modifiers.
_MODIFIER_KEYS = ((Key.alt_gr, (Key.alt_gr.value, )),
                  (Key.alt, (Key.alt.value, Key.alt_l.value, Key.alt_r.value)),
                  (Key.cmd, (Key.cmd.value, Key.cmd_l.value, Key.cmd_r.value)),
                  (Key.ctrl, (Key.ctrl.value, Key.ctrl_l.value,
                              Key.ctrl_r.value)),
                  (Key.shift, (Key.shift.value, Key.shift_l.value,
Esempio n. 2
0
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
The module containing mouse classes.

See the documentation for more information.
"""

# pylint: disable=C0103
# Button, Controller and Listener are not constants

from pynput._util import backend, Events


backend = backend(__package__)
Button = backend.Button
Controller = backend.Controller
Listener = backend.Listener
del backend


class Events(Events):
    """A mouse event listener supporting synchronous iteration over the events.

    Possible events are:

    :class:`Events.Move`
        The mouse was moved.

    :class:`Events.Click`