xkeysnail icon indicating copy to clipboard operation
xkeysnail copied to clipboard

multipurpose_modmap ctrl+click

Open davidsu opened this issue 4 years ago • 8 comments

I have the following configuration

define_multipurpose_modmap(
    Key.LEFT_CTRL: [Key.ESC, Key.LEFT_CTRL]}
)

My problem is that ctrl+click doesn't work, I suppose it's sending esc+ctrl, is there a way to fix this?

davidsu avatar Jul 24 '20 20:07 davidsu

Same problem here. The root cause may be that device.grab() completely hijack modifiers from the userland application. https://github.com/amosbird/xkeysnail/commit/1f280237e6946dc12ac84fbf1aae7fdf89a2a531

amosbird avatar Aug 02 '20 06:08 amosbird

This is likely because the multipurpose handler doesn't send the modifier press event when the press-down timer has elapsed but instead alongside the next keypress. As it is, xkeysnail is responding passively to each individual keypress and there's no timer to handle period-dependant events.

pat-flew avatar Aug 04 '20 21:08 pat-flew

That's a pity! I thought I had found great xcape replacement until I run into this issue. This behaviour effectively breaks ctrl+click. I hope someone will figure out solution for this.

amariusz avatar Aug 27 '21 12:08 amariusz

This is a hard one because a press and release means it's ESC and it's only Ctrl when paired with another event. Do you have a discrete mouse? Did you try adding it to xkeysnail so that it's clisk would count as keyboard events? If the mouse events were flowing into xkeysnail then a click should count and result in LEFT_CTRL being asserted on the output.

joshgoebel avatar Jun 05 '22 17:06 joshgoebel

Hi, @joshgoebel

I'm not sure what you mean by discrete mouse. If I remember correctly I haven't used any device specific rules in config file. In the meantime I've found that https://gitlab.com/interception/linux/tools project suits my needs in case xcape would stop working at some point in the future.

For the current moment I'm good with solutions I have.

Thanks!

amariusz avatar Jun 12 '22 12:06 amariusz

I'm not sure what you mean by discrete mouse.

I mean a separate pointing device that's not part of the keyboard... if so you'd have to add it to xkeysnail explicitly so that it can see your click and know that it should then apply the modifier - and not keep waiting for another keyboard key.

If you've moved on and are happy, could you close this issue?

joshgoebel avatar Jun 12 '22 12:06 joshgoebel

In that case I'm using discrete mouse :)

Do you have a link for sample configuration file that adds mouse to xkeysnail, in case someone reading this thread want to try it out?

I don't think I'm able to close the issue - it was open by @davidsu.

amariusz avatar Jun 12 '22 13:06 amariusz

You'd look up your mouse device (or name) and use the --device command line option to include it.

joshgoebel avatar Jun 12 '22 13:06 joshgoebel