Comments (11)
Hello!
Here a workaround:
import pyautogui
import pyperclip
def _workaround_write(text):
"""
This is a work-around for the bug in pyautogui.write() with non-QWERTY keyboards
It copies the text to clipboard and pastes it, instead of typing it.
"""
pyperclip.copy(text)
pyautogui.hotkey('ctrl', 'v')
pyperclip.copy('')
# Test
text_with_special_chars = '@/:;\\.ABCabc?!~^[]{}()'
pyautogui.write(text_with_special_chars)
# >>> //;\.ABCabc?§¨[]5° -> NOK
_workaround_write(text_with_special_chars)
# >>> @/:;\.ABCabc?!~^[]{}() -> OK :)
It solved the issue on my Windows 64-bits machine / AZERTY french keyboard
from pyautogui.
in what kind of input do you try to write that? in a input html or in a windows input?
from pyautogui.
In Windows Python IDLE, Notepad, any kind of browsers and text editors. My final goal is to input text a website.
from pyautogui.
Does the following code work?
`>>> pyautogui.press('1')
pyautogui.keyDown('1')`
from pyautogui.
Yes, both are working for numbers, but doesn't do it for letters
from pyautogui.
Sorry, I misread. I meant, try pyautogui.press('a') and pyautogui.keyDown('a'). I want to know if the problem is with typewrite() or all the keyboard functions.
from pyautogui.
Never mind. It seems that any keyboard functions related to letters won't work, but works perfectly with numbers. What is even stranger, this issue can be observed both on my laptop and PC, but the only thing that is the same is that both computers works under Russian edition of Windows 7.
from pyautogui.
>>> pyautogui.press('a')
q
looks like the keyboard layout (azerty/fr here) affects typewrite
and press
from pyautogui.
doesn't work on mac os
from pyautogui.
doesn't work on mac os
It does work using pyautogui.hotkey('command', 'v')
.
from pyautogui.
You can try :
with pyautogui.hold("command"): time.sleep(0.1) pyautogui.press("v")
from pyautogui.
Related Issues (20)
- Unify license (sublicening issue)
- Add function to drag & drop file HOT 2
- write() and typewrite() missing characters HOT 1
- pyautogui.locate false positive on full black img.png confidence=0.99
- pyautogui not working in chrome dino HOT 1
- MouseInfo 0.1.3 cannot read RGB pixel values on my iMac: NA_on_macOS HOT 1
- pyautogui.pixel() function does not get the correct pixel values on my iMac HOT 1
- pyautogui , deploy on server. HOT 1
- Feature Idea: Interactive mode HOT 1
- bug: pyautogui.moveTo() doesn't work on macOS Sonoma HOT 1
- Feature request: possibility to send keystrokes only to specified process
- Pyautogui.screenshot(region=) does not accept a variable from another file HOT 2
- click item in a dropdown menu , not working HOT 1
- linux VM doesn't accept password entered by pyautogui HOT 1
- PyAutoGUI unable to import pyscreeze due to Pillow compatibility issue.
- bug: pyautogui.moveTo method does not work when desktop has no application opened (windows)
- Method Click move cursor. HOT 2
- locateOnScreen flickery on Ubuntu HOT 1
- Bot Facebook
- Omissions in Quickstart Screenshot & Locate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyautogui.