keyboard

Cannot get wxPython to capture (some) keystrokes

Cannot get wxPython to capture (some) keystrokes Question: I’ve been having some issues with a new application I’m writing for work, in Python (3.8) and wxPython (4.1.0), regarding detecting key presses (it doesn’t). This is under Windows 10. Thinking it may be my control hierarchy "swallowing" events, I found a simple example on the web …

Total answers: 2

How can i detect key combinations in Windows python3+?

How can i detect key combinations in Windows python3+? Question: I am trying to program something that detects when a key combination is pressed and calls a certain function. So i need the program to detect something like ctrl+v when pressed and do something, but it seems like the program does not recognize ctrl+v together, …

Total answers: 2

Why pynput doesn't detect numeric keyboard presses?

Why pynput doesn't detect numeric keyboard presses? Question: I’m using python 3.7 on windows 7. Is there any way to detect number (for example: “1”) key presses in pynput module? I have tried many other modules and i got nothing except for tkinter which needs a window but i don’t want that. from pynput import …

Total answers: 4

Improve Python Code

Improve Python Code Question: I am not a good coder so I hope you can help me out with this one. Please look at my code. I use this code to convert characters to code which is send over to a computer. This code is interpeted as HID keyboard code. I have 2 questions: 1) …

Total answers: 3

Win32api's keybd_event() function problems

Win32api's keybd_event() function problems Question: I’m having some issues creating inputs with the win32api. I’m creating a voice recognition script that needs to work just like a keyboard in all contexts (including fullscreen games and such). I’ve tried a few other solutions besides win32api’s keybd_event() function but most don’t even register in fullscreen applications. I’m …

Total answers: 2

Can we Zoom the browser window in python selenium webdriver?

Can we Zoom the browser window in python selenium webdriver? Question: I am trying to ZOOM IN and ZOOM OUT the Chrome( selenium webdriver) only using keyboard. I have tried — from selenium.webdriver.common.keys import Keys driver.find_element_by_tag_name(“body”).send_keys(Keys.CONTROL,Keys.SUBTRACT). but it is not working. Need answer in python. Asked By: Dayananda || Source Answers: I was just struggling …

Total answers: 6

How to get keyboard input in pygame?

How to get keyboard input in pygame? Question: I am making a game in pygame 1.9.2. It’s a faily simple game in which a ship moves between five columns of bad guys who attack by moving slowly downward. I am attempting to make it so that the ship moves left and right with the left …

Total answers: 11

Interactive matplotlib plot with two sliders

Interactive matplotlib plot with two sliders Question: I used matplotlib to create some plot, which depends on 8 variables. I would like to study how the plot changes when I change some of them. I created some script that calls the matplotlib one and generates different snapshots that later I convert into a movie, it …

Total answers: 7

Which is the easiest way to simulate keyboard and mouse on Python?

Which is the easiest way to simulate keyboard and mouse on Python? Question: I need to do some macros and I wanna know what is the most recommended way to do it. So, I need to write somethings and click some places with it and I need to emulate the TAB key to. Asked By: …

Total answers: 5

Polling the keyboard (detect a keypress) in python

Polling the keyboard (detect a keypress) in python Question: How can I poll the keyboard from a console python app? Specifically, I would like to do something akin to this in the midst of a lot of other I/O activities (socket selects, serial port access, etc.): while True: # doing amazing pythonic embedded stuff # …

Total answers: 12