sometimes my pythonscript stops working after switching windows with <Alt>-<Tab>.
This happens under DE Cinnamon, KDE Plasma and XFCE4.
When i use the same functionality at this point of time via commandline tool xdotool the keystrokes will be sended.
When i restart X completely (normal logout/hard <Ctrl>-<Alt>-<Backspace>) the script works again.
Maybe this is wine-related ... i send Keystrokes to a WoW-Window started with wine-4.12.1.r1.gaccf1895
There's also dxvk involved.
Honestly, i don't know what information you need to narrow down the error. here are some details:
#!/usr/bin/env python3
from pynput import mouse
from xdo import Xdo
import threading
state = 0
thrCnt = 1
windowID = 0
objWin = object()
xdo = Xdo()
if windowID == 0:
objWin = xdo.search_windows(
winname=b'World of Warcraft', only_visible=True, require=True)
windowID = objWin[0]
print('First start. Set WinID to: ' + str(windowID))
def thread_Sendkey():
global state
global windowID
global objWin
while state == 1:
xdo.send_keysequence_window(objWin[0], "2", 80000)
def on_click(x, y, button, pressed):
global state
global thrCnt
v = button.value
if pressed:
if v == 8:
if state == 0:
thrCnt += 1
print('start ' + str(thrCnt) + '...')
x = threading.Thread(target=thread_Sendkey)
x.start() # start thread
state = 1
else:
print('end\n---------------------------')
state = 0
with mouse.Listener(on_click=on_click) as listenerm:
listenerm.join()
Hi folks,
sometimes my pythonscript stops working after switching windows with
<Alt>
-<Tab>
. This happens under DE Cinnamon, KDE Plasma and XFCE4. When i use the same functionality at this point of time via commandline toolxdotool
the keystrokes will be sended. When i restart X completely (normal logout/hard<Ctrl>
-<Alt>
-<Backspace>
) the script works again.Maybe this is
wine
-related ... i send Keystrokes to a WoW-Window started withwine-4.12.1.r1.gaccf1895
There's also dxvk involved.Honestly, i don't know what information you need to narrow down the error. here are some details:
The script i use: