Page 1 of 1
How to make an if statement, work inside of FastKeys...
Posted: Sep 24th, ’23, 10:11
by Oblomov
I'm trying to make the following if statement, work inside of FastKeys:
Often times when I hit CtrlF (search), I sometimes accidentally hit CtrlD, which then deletes a shortcut... I think there've been a few times in the past, where I was in such a hurry, that I didn't notice it.
So every time this command would be used inside of FastKeys, I'd like for there to be an audio alert of it. However, it for some reason doesn't execute, the if statement that is...


Re: How to make an if statement, work inside of FastKeys...
Posted: Sep 24th, ’23, 13:14
by Tom
Ctrl+D creates a duplicate in FastKeys and does not delete anything.
Your code works for me, do you have a speaker turned on?
Re: How to make an if statement, work inside of FastKeys...
Posted: Sep 24th, ’23, 17:14
by Oblomov
Tom wrote: ↑Sep 24th, ’23, 13:14
Ctrl+D creates a duplicate in FastKeys and does not delete anything.
Your code works for me, do you have a speaker turned on?
I see. Though for me in regards to this command, it always just selects some number of shortcuts or/and deletes them... Speaker turned on, yes. SoundBeep works fine for me in several other commands. It just seems as though the if statement doesn't get picked up for some reason...
Tried:
• Just adding 'FastKeys', instead of '!FastKeys' (no single quotes)
• Putting
Code: Select all
if WinActive("!FastKeys")
{
SoundBeep 1500
}
on top
What's strange however, is that the code works for a shortcut like 'Ctrl + Alt + A', but not for 'Ctrl + D'. As in, the beep comes through... Even if you remove the if statement and just add 'SoundBeep 1500', 'Ctrl + D' still doesn't pick it up.
Also tried:
Code: Select all
SendLevel 1
SoundBeep 1500
SendLevel 0
Still no beep...
Also tried having it just open some random .mp3, in hopes of being able to later have some beep play a sound, whenever the command takes place inside of FastKeys... nothing... Good Lord...
Re: How to make an if statement, work inside of FastKeys...
Posted: Sep 24th, ’23, 20:33
by Tom
What is the first part of the script doing? What are you trying to accomplish?
As said, if WinActive works for me.
Re: How to make an if statement, work inside of FastKeys...
Posted: Sep 27th, ’23, 16:46
by Oblomov
Tom wrote: ↑Sep 24th, ’23, 20:33
What is the first part of the script doing? What are you trying to accomplish?
As said, if WinActive works for me.
Removing a line and saving, a command I often used with Notepad.
Either way, it seems I've 'fixed' this now... It appears I had a 'CtrlD' hotkey inside of an AHK script I long forgot about it, which was overriding the command inside of FastKeys... Rats!
