I’m trying to set my first steps in a Gnome Extension to help visually impaired people with a very narrow field of vision to find the cursor again by moving to it a fixed location. (top/left, or center)
Imagine someone with glaucoma, they are looking through a straw, so they have to scan the screen from left top to right bottom (or sometimes even a sentence character by character).
I’m able to bind a keyboard shortcut to read the cursor location, but I can’t find a way of moving it.
let [mouse_x, mouse_y, mask] = global.get_pointer();
global.set_pointer(0,0) // fails
I hacked already a workaround together with dotool, but I think that a Gnome Shell Extension is more secure and appropriate.
And honestly it were my first hours with a Gnome Extension, but I fail to see how proper debugging is done.
dbus-run-session -- gnome-shell --nested --wayland is fun, but I had a typo in ExtensionUtils.getSettings("org.gnome.shell.extensions.test"): no error message was shown.
And I found out the hard way that I should run each time glib-compile-schemas ~/.firstname.lastname@example.org/schemas on a schema change.
And for example where can you find info about the global object?
a function to set the location of the cursor to a fixed place on a key-press
global.set_pointer(50%,50%) // (bogus code to work)
Maybe I did not explain myself properly but I try to help people with a very narrow field of vision. They often cant’f find the cursor. So I wanted to create an Gnome extension that moves the cursor to the center of the main monitor (or any configurable location) on a global shortcut.
Dead simple. Like I written before I have a sub-optimal solution with the external dotool.
When I lose track of the mouse myself I simply move it left, pick it up and move it left again, until it’s on left top, but it seems that older/disabled people are reluctant to move their mouse when the don’t see where it is.
( And I agree, every JS driven website can bind any event to a mouse movement nowadays.)
Pardon my ignorance but the more I read the less I understand.
Clutter is going to be retired, so to be future-proof I need to switch to GTK soon, but as it seems GTK4 does not support warping the pointer- because it’s confusing to the user (nonsense would I say, I’m just presenting the usecase here)- so I should use platform APIs such as XWarpPointer() directly, which sounds like it does not work on Wayland at all.
So although I can get my extension working in Ubuntu today, it’s doomed for tomorrow?
Or can I use XWarpPointer() (or any alternative) in GNOME 42+ Wayland right now.