pynput

Mouse coordinates on Python with PySimpleGUI

Mouse coordinates on Python with PySimpleGUI Question: I’m trying to get the mouse coordinates, with pynput, and see it with a GUI with PySimpleGUI but I am getting a lot of problens, and I don’t know how can I do this. I want to show the mouse coordinates at the "x – y" string below …

Total answers: 2

Key repeat after input in pynput

Key repeat after input in pynput Question: I basically need something to take input from and print it or something else, but whatever I press it will repeat after I (close the program, read text input, etc) here is an example: what I tried: I used the keyboard module instead of pynput module I used …

Total answers: 1

OpenCV mouse coordinates differs from pynput mouse.position

OpenCV mouse coordinates differs from pynput mouse.position Question: I was testing out OpenCV‘s mouse callback function with pynput.mouse and I realised the coordinates of the cursor are different. Here is the output from the code below. Does anyone know what the offset is as it does not seem to be consistent in the output import …

Total answers: 1

event.key seems to not be Key [pynput]

event.key seems to not be Key [pynput] Question: I am writing an application which uses pynput to gather raw keyboard input. I needed a form of key event that could be instantiated, deleted, enabled, and disabled arbitrarily during runtime, so pynput’s Global Hotkey system wouldn’t work. So, I created my own event class: keyEvents = …

Total answers: 1

GlobalHotKeys pynput not working not reacting to function keys

GlobalHotKeys pynput not working not reacting to function keys Question: community. I’m trying to put together a quick hotkey script in python here. For some reason it doesn’t react to function keys, meaning the expression ‘<ctrl>+<F2>’: function_1 doesn’t work. I was not able to find any clues in the official documentation or other examples online. …

Total answers: 2

How to prevent Pynput when the application is in background in Python

How to prevent Pynput when the application is in background in Python Question: I’m trying to prevent the pynput framework when my GUI is in background. I’m using pynput to make shortcuts for some buttons. I use PyQT5 for GUI. from pytube import YouTube from PyQt5 import QtCore, QtGui, QtWidgets from tkinter.messagebox import showerror as …

Total answers: 1

Why is loop.create_task taking so long to execute?

Why is loop.create_task taking so long to execute? Question: I am trying to emulate the reading of a NFC chip by pressing the cmd key in a little python script that acts as a socket-io server. It’s job is to notify a client after the cmd key has been pressed. It works, but emulate_nfc_tag() takes …

Total answers: 1

pynput presses are not being detected by some programs

pynput presses are not being detected by some programs Question: I’m trying to create a remote using my phone for a game with sockets and pynput. Although some apps such as Chrome or Notepad detect and display the keys that have been pressed with the controller function of pynput (press and release), other ones (such …

Total answers: 1

How to trigger mouse clicks only when a key is pressed ? In Python

How to trigger mouse clicks only when a key is pressed ? In Python Question: I want to make a program or when I click on a key the mouse clicks automatically (as long as I click on the key) if I do not click on the key it stops. I don’t want the clicks …

Total answers: 1

pynput.mouse Listener do not stop

pynput.mouse Listener do not stop Question: Here is my prank code for my friend but I can not stop this program from keyboard when I make executable. How can I stop this listener from keyboard shortcut. I know it is thread issue. import sys import pyautogui import keyboard from pynput.mouse import Listener from threading import …

Total answers: 2