Bug?

Get help with using AutoHotkey and its commands and hotkeys
Redbird
Posts: 8
Joined: 03 Jun 2019, 17:25

Bug?

03 Jun 2019, 17:56

Let's say I want to make it so that whenever I press shift + F1, AHK sends shift + 1. So pressing shift + F1 in Notepad should write "!". I tried the following code:

Code: Select all

Shift & F1::
	Send, +1
Return
...and it only works partially. Left shift + F1 writes "!", but right shift + F1 writes "1" (no shift) instead.

I also tried this alternative:

Code: Select all

LShift & F1::
	Send, +1
Return

RShift & F1::
	Send, +1
Return
And results are the same. Left shift works properly, right shift doesn't. Am I doing something wrong, or is it an AHK bug?
swagfag
Posts: 3318
Joined: 11 Jan 2017, 17:59

Re: Bug?

03 Jun 2019, 18:11

win10 1903 x64, ahk 1.1.30.3, ran in notepad just:

Code: Select all

Shift & F1::
	Send, +1
Return
keyhistory:

Code: Select all

A1  136	 	d	6.11	RShift         	*Untitled - Notepad
70  03B	h	d	0.30	F1             	
A0  02A	i	d	0.00	LShift         	
A1  136	i	u	0.00	RShift         	
31  002	i	d	0.00	1              	
31  002	i	u	0.00	1              	
A0  02A	i	u	0.01	LShift         	
A1  136	i	d	0.00	RShift         	
70  03B	s	u	0.09	F1             	
A1  136	 	u	1.09	RShift
as u can see everything checks out.
1. RShift is physically pressed and held down
2. + in Send +1 logically presses and holds LShift down(thats the default methinks)
3. since u arent using {Blind}, any and every down state modifier, in this case the only one is RShift, is temporary released
4. logical press 1
5. logical release 1
6. logical release LShift
7. undo what u did in 3.
8. suppress F1 Up since no such hotkey has been defined
9. i physically release RShift

post specs, keyhistory, hotkeys& their methods, other scripts running?, more info
Redbird
Posts: 8
Joined: 03 Jun 2019, 17:25

Re: Bug?

03 Jun 2019, 21:08

I found out the root of the issue. In the same script, I had this code:

Code: Select all

1::
		Send, {F6}{Numpad1}
Return
For some reason, pressing right shift + F1 executed that function, but left shift + F1 didn't. Any ideas why that is and how to fix it? I would like the Shift & F1 function to send shift + 1 all the time, without executing the other function.
swagfag
Posts: 3318
Joined: 11 Jan 2017, 17:59

Re: Bug?

04 Jun 2019, 02:07

see last sentence of previous post
Rohwedder
Posts: 2705
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Bug?

04 Jun 2019, 02:17

Hallo,
try:

Code: Select all

+F1:: ;replaces Shift & F1::
	Send, +1
Return
$1:: ;replaces 1::
	Send, {F6}{Numpad1}
Return

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], GTM, Rohwedder, timoshina and 366 guests