Two non-functional key combination

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 25 May 2023, 06:46

I know how you can find out!

:) :wave:

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 07:17

Just tried the following. ^+d short cut does not work while the following script. an you please help. he caps problem has been resolved. hank you in advance.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 07:18

Oops. Here is the script.

Code: Select all

r::r
+d::Send {Blind}d
^+d::Send 9999
r & d::
d & r::Send If I am not in the reading room, I can be reached on my cell phone at (434)-760-2158. Thank you.

$d::
Send d
KeyWait r, DT.2
If !ErrorLevel
 Send x
Return

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 25 May 2023, 07:27

It worked here. Test in Notepad. Close other scripts.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 07:33

for me, ^+d sends 9999. thanks.

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 25 May 2023, 07:47

Well, that is what the script says to do. It is an example that you can change.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 07:55

Closed rest of the scripts. ^+d still send 9999. Thank you.

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 25 May 2023, 07:56

My explanation of your finding is in my previous post.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 07:57

So I can change ^+d::Send 9999 to ^+d::Send ^+d? Thank you.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 08:02

^+D is a shortcut for a specific program so I am at a loss and don't know what else to do. Thanks.

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 25 May 2023, 08:26

If you are not going to post your script, you could always delete the corresponding line in the script that I posted, right?

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 08:38

My apologies. I posted my script before. The one when open sends 9999. I was asking if changing 9999 to ^+d will do the trick. As far as what ^+d does, it is not past of any of my ahk script. Even before i tried ahk, I was using ^+d for a program at work. The program allows built in short cuts for several actions within the program. ^+d is part of it. So, there is nothing for me to post. Not holding back any ahk script. Thank you.

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 25 May 2023, 09:16

You can delete line 3.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 09:53

Thank you. will change the script tonight at home. will also try to learn what "blind" does. Sorry, I have very limited knowledge about ahk. Thanks.

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 25 May 2023, 09:55

Blind mode:
The Blind mode avoids releasing the modifier keys (Alt, Ctrl, Shift, and Win) if they started out in the down position.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 11:10

Thank you.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 25 May 2023, 17:34

Deleting third line did not execute ^+d command. So I changed the third line and replaced 9999 with ^+d. That seems to have worked. It sent d with d, r with r, D with Shift+d, R with shift+r. I don't have the work program so I created a separate script to test if the ^+d worked. And it worked.

The script is as follows.

Thank you Mikeyww. The script and the help you have provided are going to be extremely valuable on a daily basis.

Code: Select all

r::r
+d::Send {Blind}d
^+d::Send ^+d

r & d::
d & r::Send #4

$d::
Send d
KeyWait r, DT.2
If !ErrorLevel
 Send x
Return
I tested ^+d with the following script.

Code: Select all

^+d::
Send, #3
Return

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 27 May 2023, 14:33

The following two scripts work perfectly when used separately. However, when I use them simultaneously, #9 of script 1 is not sent. Everything else works together but "Send, #9" does not work when the script 2 is open. It works fine when the script 2 is not open. I have tried but don't understand why that happens. Is there a workaround?
Thank you in advance.

Script1

Code: Select all

r::r
+d::Send {Blind}d
^+d::Send ^+d

r & d::
d & r::
Send, #9

$d::
Send d
KeyWait r, DT.2
If !ErrorLevele.
 Send x
Return
Script 2

Code: Select all

t::t
+r::Send {Blind}r
^+r::Send ^+r

t & r::
r & t::
Send, #8

$r::
Send r
KeyWait t, DT.2
If !ErrorLevel
 Send x
Return

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Two non-functional key combination

Post by mikeyww » 27 May 2023, 17:04

Problems:

1. Duplicate hotkeys: combine your scripts into one.

2. Syntax error in the first script. Run the script to see it.

3. Potentially missing Return commands at the end of subroutines. Without a Return command (or other control flow command), the script will continue to the next statement. To understand your script, follow it line by line.

Joey5
Posts: 40
Joined: 19 May 2023, 05:25

Re: Two non-functional key combination

Post by Joey5 » 28 May 2023, 09:49

I give up. It’s too rich for me. Other than send x line as potential duplicate, I didn’t notice anything. Changing that didn’t help. In fact, I don’t even understand why send x is in the script. I’ll continue to dig around. Keeping hopes alive to learn something. Thanks for your helping all along.

Post Reply

Return to “Ask for Help (v1)”