AHK_X11 icon indicating copy to clipboard operation
AHK_X11 copied to clipboard

send make the key being considered as released (unlike AutoHotkey)

Open Magikh42 opened this issue 1 year ago • 3 comments

Hello, I have this script that works in Windows but not in AHK_X11:

	*Space::
		send, {Space}
		send, {LAlt down}
		KeyWait, Space
		send, {LAlt up}
		return

It should make pressing Space send the Space character then Alt is considered down until Space is released

Magikh42 avatar Dec 13 '24 17:12 Magikh42

Using this script

	*Space::
		send, {Space}
		echo down
		send, {LAlt down}
		KeyWait, Space
		echo up

Pressing alt (without releasing) print both down and up to the terminal where ahk was launched Releasing does not print

Magikh42 avatar Dec 13 '24 17:12 Magikh42

If I replace *Space by a it works unless the key sent is also a so it seems KeySend makes the key tp be considered as released (this is not the case on AutoHotkey)

Magikh42 avatar Dec 13 '24 17:12 Magikh42

Workaround:

*Space::
	send, {Space}
	send, {Space down}
	echo down
	send, {LAlt down}
	KeyWait, Space
	echo up

I leave the issue open as it is not behaving like AutoHotkey I don't know if it is relevant but I'm on EndeavourOS and my desktop environment is Cinnamon

Magikh42 avatar Dec 13 '24 17:12 Magikh42