02-25-2025, 08:28 AM
Hello,
I need to create some functions to listen for Windows key combinations, such as Ctrl+Win+Right Arrow (Desktop Next).
When I run the following program and press the keys manually, it works fine.
However, when I press the Desktop Next key(a special function key) on the keyboard, it seems only Ctrl is captured and blocked, while Win+Right Arrow is executed.
I can't use "
"because it results in "Failed to register hotkey. Hot key is already registered (1409)."
Sorry, I’m a beginner. My code is based on examples from the cookbook and responses from ChatGPT.
Is there any other way to achieve this functionality? I would really appreciate it.
Thanks.
I need to create some functions to listen for Windows key combinations, such as Ctrl+Win+Right Arrow (Desktop Next).
When I run the following program and press the keys manually, it works fine.
However, when I press the Desktop Next key(a special function key) on the keyboard, it seems only Ctrl is captured and blocked, while Win+Right Arrow is executed.
var timeOutTime = -3;
if (keys.waitForKey(timeOutTime, KKey.Ctrl, up: false, block: true) &&
keys.waitForKey(timeOutTime, KKey.Win, up: false, block: true) &&
keys.waitForKey(timeOutTime, KKey.Right, up: false, block: true))
{
print.it("Pass");
}
else
{
print.it("Fail");
}
I can't use "
"because it results in "Failed to register hotkey. Hot key is already registered (1409)."
Sorry, I’m a beginner. My code is based on examples from the cookbook and responses from ChatGPT.
Is there any other way to achieve this functionality? I would really appreciate it.
Thanks.