KdeEcoTest proposal: Adding support for windows
Project abstract
I aim to provide windows support for KdeEcoTest. It will be done using win32gui module of python. This will provide support for Windows and ensure compatibility, allowing the same scripts to be used for testing on both GNU/Linux and Windows platforms.
Proposal
Adding py32gui
will enable KdeEcoTest to be used on Windows operating systems, which will fix issue !7. For windows systems, py32gui
will replace python-libxdo
. The files at KdeEcoTest/core will be updated.
- win32gui.SetActiveWindow: Used to select a window as the active window.
import win32gui
gcompris_handle = win32gui.FindWindow(None, "GCompris")
win32gui.SetActiveWindow(gcompris_handle)
win32gui.SetForegroundWindow(gcompris_handle)
- win32gui.SetWindowPos: Used to set the position and size of a window.
import win32gui
import win32con
gcompris_handle = win32gui.FindWindow(None, "GCompris")
win32gui.SetWindowPos(gcompris_handle, win32con.HWND_TOP, x, y, width, height, win32con.SWP_SHOWWINDOW)
- win32api.SetCursorPos: Used to set the position of the cursor. win32gui.SetCursor can also be used.
import win32api
win32api.SetCursorPos((x, y))
- win32gui.SendMessage: Used to emulate mouse click and keyboard inputs. win32api.mouse_event can also be used for emulating mouse clicks.
import win32api
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
time.sleep(0.005)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
import win32gui
win32gui.SendMessage(hwnd, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, win32api.MAKELONG(x, y))
win32gui.SendMessage(hwnd, win32con.WM_LBUTTONUP, 0, win32api.MAKELONG(x, y))
Timeline
Week | Start | End | Milestone |
---|---|---|---|
1 | 17/01/24 | 24/01/24 |
|
2 | 25/01/24 | 31/01/24 |
|
3 | 01/02/24 | 07/02/24 | Add support for window management:
|
4 & 5 | 08/02/24 | 21/02/24 | Add support for emulating mouse inputs:
|
6 & 7 | 22/02/24 | 06/03/24 | Add support for emulating keyboard inputs:
|
8 & 9 | 07/03/24 | 20/03/24 |
|
10 | 21/03/24 | 30/03/24 | Bug Fixing and Finalizing |
References / relevant background info
- I was tasked with issue !11, which I completed.(KdeEcoTest)
- Added GitHub-action workflow for welcoming first-time-contributor on raising the PR.(CircuitVerse
How to reach you
email: amartya.3654@gmail.com
element: @camartya:matrix.org
Note: we don't need (yet) your personal address/phone, it will be necessary only if you succeed the SoK and wants to get goodies.
Edited by Amartya Chakraborty