I am building out a gnome extension that will allow me to have several keybinding shortcuts. The first one I am trying to tackle is HJKL for arrow keys like in vim. I am using the following code to accomplish this:
let mode = Shell.ActionMode.ALL;
let flag = Meta.KeyBindingFlags.NONE;
let settings = getSettings();
Main.wm.addKeybinding("left-h", settings, flag, mode, () => log('test') );
here is the shortcut schema:
<key type="as" name="left-h">
<default><![CDATA[['h']]]></default>
<summary>The shortcut key</summary>
<description>You can create GTK entry in pref and set it as CDATA</description>
</key>
This all works as expected. My only issue is that there is about one second of latency when the key is pressed to when there is a log to the output. My first thought was that the log is just slow, so I set it up to call a python script with spawn_command_line_sync that is responsible for simulating a key press which also had ~1s of latency after the button was pressed to when the command fired. (I am using a python script for this because I couldn't find a way to press keys via GJS) Is it possible to get rid of that latency? Right now they keybindings are unusable because of it.