Hotkey not working twice

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Question84
Newbie
Posts: 5
Joined: Sun Nov 17, 2019 5:27 pm

Hotkey not working twice

Post by Question84 » Sun Nov 17, 2019 5:33 pm

I have a hotkey SH+CTRL+Down.
It works fine the first time, but when I do not release SH+CTRL and press Down again, the hotkey does not work.
For it to work I have to release SH+CTRL and then again press SH+CTRL+Down.
Is it a bug? How to make it work?

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Hotkey not working twice

Post by Dorian (MJT support) » Mon Nov 18, 2019 9:00 am

I just experimented with this and SHIFT + CTRL isn't an option for HotKeys. CTRL + SHIFT is.

However, as long as CTRL/SHIFT are held down at the same time as Down is pressed, this should work just fine. I was able to execute a macro multiple times whichever of the two I held down first.

Does the same issue arise if you use a different key combination? Could there be a clash with another application trying to reserve that key combination?
Yes, we have a Custom Scripting Service. Message me or go here

Question84
Newbie
Posts: 5
Joined: Sun Nov 17, 2019 5:27 pm

Re: Hotkey not working twice

Post by Question84 » Mon Nov 18, 2019 11:24 am

This is my code:

Let>SK_DELAY=10
Press LCtrl
Press LShift
Press Right
Press Right
Press Right

It is for selecting 3 words in a text editor.
Hotkey is: Ctrl + Shift + Down

I press on keybord Ctrl+Shift and keep them pressed, then when I first hit Down it works, but when I hit the Down key a second time (while still holding down Ctrl+Shift, without realeasing them), the macro is not executed, instead the cursor moves down.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Hotkey not working twice

Post by Dorian (MJT support) » Mon Nov 18, 2019 2:14 pm

I see. I think the problem is your script is pressing CTRL and SHIFT but not releasing them. Then they're still pressed and you're having trouble subsequently using the hotkey.

Try this instead :

Code: Select all

press ctrl
press shift
press right *3
release shift
release ctrl
Yes, we have a Custom Scripting Service. Message me or go here

Question84
Newbie
Posts: 5
Joined: Sun Nov 17, 2019 5:27 pm

Re: Hotkey not working twice

Post by Question84 » Tue Nov 19, 2019 12:19 pm

Nope, not working. That was what I had the first time, and removed release commnads because I thought that they caused the problem.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Hotkey not working twice

Post by Dorian (MJT support) » Tue Nov 19, 2019 1:46 pm

Yes, we have a Custom Scripting Service. Message me or go here

Question84
Newbie
Posts: 5
Joined: Sun Nov 17, 2019 5:27 pm

Re: Hotkey not working twice

Post by Question84 » Tue Nov 19, 2019 2:47 pm

You are not doing it the way I specified. You are moving the cursor between the two commands and cancel the selection. Please do it twice as I specified (no clicking and no releasing of Ctrl and Shift between hitting Down key two times). The result should be 6 words selected.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Hotkey not working twice

Post by Dorian (MJT support) » Wed Nov 20, 2019 10:13 am

https://1drv.ms/v/s!Ao3gpMOkYdfwlagSEpv ... Q?e=ImUgYx

The thing with this is though, you can run this hotkey multiple times in a row, but you do have to release the keys inbetween - otherwise you're not performing the hotkey sequence you set. CTRL_SHIFT_DOWN...release...CTRL_SHIFT_DOWN...release...CTRL_SHIFT_DOWN...release... Or... SHIFT_CTRL_DOWN...release...SHIFT_CTRL_DOWN...release...SHIFT_CTRL_DOWN...release...SHIFT_CTRL_DOWN...release...

So it seems the hotkey is only working once because you're only actually using it once. Subsequent times you're not pressing the entire hotkey sequence.
Yes, we have a Custom Scripting Service. Message me or go here

Question84
Newbie
Posts: 5
Joined: Sun Nov 17, 2019 5:27 pm

Re: Hotkey not working twice

Post by Question84 » Wed Nov 20, 2019 12:24 pm

OK, so we at last agree on the behaviour part.

Yet I would disagree with "you're only actually using it once", as the MS hotkey behaviour seems inconsistent with any other Windows hotkey behaviour.

Let's take the Ctrl + V shortcut, you can press and hold Ctrl and then hit V several times, each time triggering pasting operation. You do not need to release Ctrl for the operation to be triggered.

Therefore I would say this is a bug that should be corrected.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Hotkey not working twice

Post by Dorian (MJT support) » Wed Nov 20, 2019 7:28 pm

This is not a bug.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts