[gnome-shell-ext] How to trap keystrokes?
- From: Andrew de los Reyes <adlr gmail com>
- To: gnome-shell-extensions-list gnome org
- Subject: [gnome-shell-ext] How to trap keystrokes?
- Date: Sat, 21 Aug 2021 13:20:47 -0700
Hey folks,
I'm trying to develop an extension that will hide the mouse cursor
when a keystroke is pressed and show the cursor when it moves. I think
I have the JS APIs working for the cursor show/hide, but I'm
struggling to find anything that works to trap keystrokes.
FWIW, I'm using Ubuntu 21.04 with Wayland and the default Gnome desktop.
I've tried global.stage.connect('key-press-event', () => {...});, and
while it does return a connection identifier, no keystrokes ever seem
to trigger the callback.
Any advice?
(Note, if writing a daemon does the job, I would be happy to solve it
that way, but I'm not aware of any way to hide/show the mouse cursor
from outside the gnome-shell process. I scoured d-bus for a while, but
didn't see any API that would do it.)
Thanks very much,
-adlr
[Date Prev][Date Next] [Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]