All these days I am struggling by myself to find solutions on pywayland and pywlroots/wlroots that do the same roles when are about do key press/release, mouse press/release and get the current mouse position on the screen. For example, considering Xlib is necessary to generate a display object (Display(os.environ['DISPLAY'])) and this object contains with itself some methods responsible to access screen attributes:
Display(os.environ['DISPLAY']).screen().root.query_pointer._data.coord["root_x"] (To get the x current mouse location) and Display(os.environ['DISPLAY']).screen().root.query_pointer._data.coord["root_y"] (To get the y current mouse location) considering that Display(object) belongs from Xlib.display module.
As well as the fake_input(Display(os.environ['DISPLAY']), X.any_event, button, x=value_x,y_value_y) to make events such as mouse movement, button mouse press/release, and Display(os.environ['DISPLAY']).sync() to refresh the display state, considering that fake_input() belongs from Xlib.ext.xtest module and X from Xlib package.
Hello there,
All these days I am struggling by myself to find solutions on pywayland and pywlroots/wlroots that do the same roles when are about do key press/release, mouse press/release and get the current mouse position on the screen. For example, considering Xlib is necessary to generate a display object (
Display(os.environ['DISPLAY'])
) and this object contains with itself some methods responsible to access screen attributes:Display(os.environ['DISPLAY']).screen().root.query_pointer._data.coord["root_x"]
(To get the x current mouse location) andDisplay(os.environ['DISPLAY']).screen().root.query_pointer._data.coord["root_y"]
(To get the y current mouse location) considering thatDisplay(object)
belongs fromXlib.display
module.As well as the
fake_input(Display(os.environ['DISPLAY']), X.any_event, button, x=value_x,y_value_y)
to make events such as mouse movement, button mouse press/release, andDisplay(os.environ['DISPLAY']).sync()
to refresh the display state, considering thatfake_input()
belongs fromXlib.ext.xtest
module andX
fromXlib
package.Where could I see a tutorial from the pywayland and pywlroots usage? I saw https://github.com/flacjacket/pywlroots/blob/main/wlroots/wlr_types/virtual_pointer_v1.py and https://github.com/flacjacket/pywlroots/blob/main/wlroots/wlr_types/virtual_keyboard_v1.py but I have no idea how to use them. I am researching them also.