xbindkeys-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] add scheme function "send-key-event" to allow implementation of


From: Kangjing (Chaser) Huang
Subject: [PATCH] add scheme function "send-key-event" to allow implementation of xevent passthourgh
Date: Tue, 1 Sep 2020 00:43:34 -0400

Hi there,

I was trying to implement within xbindkeys a conditional key mapping: I would like some keys like space, tab, q, w, e, r to perform certain functions when a certain window is focused, but to behave normally elsewhere.

I used scheme config trying to make this possible, however, I realized that I need to generate the keystrokes again in the config if the condition is not met, because xbindkeys has grabbed the key input and would not have the key event to trigger a default behavior, and no matter what external tools I used (I tried xte and xdotool) to generate the keystrokes, it would trigger xbindkeys again and ended up in an infinite loop. It seems impossible to disable xbindkeys' key grab in the middle of a key handling function and then to resume it later.

So I decided to hack xbindkeys and I added a "send-key-event" scheme function. This function uses XSendEvent underneath and that by default would ignore any active grabs, thus would not create the infinite loop.

I am not 100% sure if this is the correct way to do this, but I could not find any other way. The Patch is attached, please take a look and let me know if you think this makes sense.

Thanks,
Chaser


--
Chaser

Attachment: send_key_event.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]