功能:完善2K串流、显示恢复与输入优化
This commit is contained in:
1 parent
e47b01beec
commit
938ec97cce
95 files changed
+5788
-72
No files matched your search
@@ -0,0 +1,26 @@
|
||||
"""X11 test only: inject 32 alternating left/right clicks into the bench window."""
|
||||
import ctypes
|
||||
|
||||
x11 = ctypes.CDLL("libX11.so.6")
|
||||
xtest = ctypes.CDLL("libXtst.so.6")
|
||||
x11.XOpenDisplay.argtypes = [ctypes.c_char_p]
|
||||
x11.XOpenDisplay.restype = ctypes.c_void_p
|
||||
x11.XFlush.argtypes = [ctypes.c_void_p]
|
||||
x11.XCloseDisplay.argtypes = [ctypes.c_void_p]
|
||||
xtest.XTestFakeMotionEvent.argtypes = [ctypes.c_void_p, ctypes.c_int,
|
||||
ctypes.c_int, ctypes.c_int, ctypes.c_ulong]
|
||||
xtest.XTestFakeButtonEvent.argtypes = [ctypes.c_void_p, ctypes.c_uint,
|
||||
ctypes.c_int, ctypes.c_ulong]
|
||||
display = x11.XOpenDisplay(None)
|
||||
if not display:
|
||||
raise RuntimeError("X11 unavailable")
|
||||
try:
|
||||
for index in range(32):
|
||||
x = 640 if index % 2 == 0 else 1920
|
||||
assert xtest.XTestFakeMotionEvent(display, -1, x, 600, 0)
|
||||
assert xtest.XTestFakeButtonEvent(display, 1, 1, 0)
|
||||
assert xtest.XTestFakeButtonEvent(display, 1, 0, 0)
|
||||
x11.XFlush(display)
|
||||
finally:
|
||||
x11.XCloseDisplay(display)
|
||||
print("Injected 32 clicks, expected L,R alternating; final pointer on R")
|
||||
Reference in new issue
Block a user