alt key misfunctions in combination keys like "!m"

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
fatsen
Posts: 6
Joined: 07 Mar 2017, 00:36

alt key misfunctions in combination keys like "!m"

20 Apr 2017, 02:48

The script is as follows.
When I press the Alt & m key in the windows of Internet Explorer or notepad++, the menu bar will display, which is the function of the seperate alt key. Because of that, ^c can't function as hoped (the selected text can't be copied). So the msgbox is blank. While the script can function normally in the windows of MS Word or notepad.
Thanks very much.

Code: Select all

!m:: 	
	clipboard:=
	send ^c
	sleep 200
	msgbox %clipboard%
return
fatsen
Posts: 6
Joined: 07 Mar 2017, 00:36

Re: alt key misfunctions in combination keys like "!m"

20 Apr 2017, 17:55

PipeDreams wrote:I tested this in NP++, I can not replicate the error. It copies the text right into the MsgBox on my PC. Your script seems to work.
What i want to say is that when there is the Alt key in combination keys like "!m", sometimes it doesn't work normally in some applications, it works like "press and release the ALT key at first, and then press and release the ALT & m combination key". In my computer, this script also works in MS Word and Notepad, so I don't know in which applications it would work normally.
My notepad++ is portable version, it might be relevant to the misfuction of the script. However, the Internet Explorer is the defaulted application of the operating system, which should not cause misfuction.(PS. The operating system is 64bit Windows 7, and the Internet Explorer version is 11.0.9600.18376.)
Thanks.
ahk_nb

Re: alt key misfunctions in combination keys like "!m"

20 Apr 2017, 18:23

Code: Select all

!m:: 	
	clipboard:=
	send ^c
	clipwait, 0 ; try this intead of sleep 200, hope it helps...
	msgbox %clipboard%
return
fatsen
Posts: 6
Joined: 07 Mar 2017, 00:36

Re: alt key misfunctions in combination keys like "!m"

21 Apr 2017, 02:56

I have tried, unfortunately it doesn't work. Thanks all the same.
ahk_nb wrote:

Code: Select all

!m:: 	
	clipboard:=
	send ^c
	clipwait, 0 ; try this intead of sleep 200, hope it helps...
	msgbox %clipboard%
return
fatsen
Posts: 6
Joined: 07 Mar 2017, 00:36

Re: alt key misfunctions in combination keys like "!m"

26 Apr 2017, 03:44

The worst solving method. When the app is Internet Explorer, send {alt}. The modified script is as follows.

Code: Select all

!m::
	ifwinactive ahk_exe iexplorer.exe	
		send {alt} 	
	clipboard:=
	send ^c
	sleep 200
	msgbox %clipboard%
return
fatsen wrote:The script is as follows.
When I press the Alt & m key in the windows of Internet Explorer or notepad++, the menu bar will display, which is the function of the seperate alt key. Because of that, ^c can't function as hoped (the selected text can't be copied). So the msgbox is blank. While the script can function normally in the windows of MS Word or notepad.
Thanks very much.

Code: Select all

!m:: 	
	clipboard:=
	send ^c
	sleep 200
	msgbox %clipboard%
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 243 guests