Shutcuts conflict

Get help with using AutoHotkey and its commands and hotkeys
Calvin
Posts: 37
Joined: 22 Jul 2016, 01:11

Shutcuts conflict

14 Feb 2019, 08:52

Hi

I have made a program with many shutcuts. But Only CTRL+ALT+?? AND CTRL+SHIFT+?? but why is my normal shutcuts in windows not working ?
Ex CTRL+C and CTRL+V don´t work if I run my program.

Thanks for your replay.
swagfag
Posts: 2237
Joined: 11 Jan 2017, 17:59

Re: Shutcuts conflict

14 Feb 2019, 08:55

without seeing code, noone can answer that
rdllngr
Posts: 53
Joined: 22 Sep 2017, 09:39

Re: Shutcuts conflict

14 Feb 2019, 09:08

Maybe you need to tell the AHK that hotkeys should work only on the program you want.

For example, run this script, open your Notepad, and press Ctrl + Enter. After this, try Ctrl + Enter on your desktop.
|
v

Code: Select all

#SingleInstance Force

DetectHiddenWindows, On
SetTitleMatchMode, 2
#IfWinActive, ahk_exe notepad.exe ; <--- This isolates the hotkeys in Notepad

$^Enter::
MsgBox, "Example 1: You pressed 'Ctrl + Enter', but only works inside Notepad"
return

#IfWinActive ; <--- End of isolation

$^Enter::
MsgBox, "Example 2: You pressed 'Ctrl + Enter', but only works outside Notepad"
return
Calvin
Posts: 37
Joined: 22 Jul 2016, 01:11

Re: Shutcuts conflict

14 Feb 2019, 10:35

I have the problem with CTRL+C and CTRL+V with this code.

When I pressing CTRL+C the program is display CW--C why ?

Code: Select all

Shutcuts(strTest)
{
	msgbox "You have pressed " %strTest%
}

; CTRL+SHIFT+A
^+a::Shutcuts("CS--A")

; CTRL+SHIFT+B
^+b::Shutcuts("CS--B")

; CTRL+SHIFT+C
^+c::Shutcuts("CS--C")

; CTRL+SHIFT+D
^+d::Shutcuts("CS--D")

; CTRL+SHIFT+E
^+e::Shutcuts("CS--E")

; CTRL+SHIFT+F 
^+f::Shutcuts("CS--F")

; CTRL+SHIFT+G 
^+g::Shutcuts("CS--G")

; CTRL+SHIFT+H 
^+h::Shutcuts("CS--H")

; CTRL+SHIFT+I 
^+i::Shutcuts("CS--I")

; CTRL+SHIFT+J 
^+j::Shutcuts("CS--J")

; CTRL+SHIFT+K 
^+k::Shutcuts("CS--K")

; CTRL+SHIFT+L 
^+l::Shutcuts("CS--L")

; CTRL+SHIFT+M 
^+m::Shutcuts("CS--M")

; CTRL+SHIFT+N 
^+n::Shutcuts("CS--N")

; CTRL+SHIFT+O 
^+o::Shutcuts("CS--O")

; CTRL+SHIFT+P 
^+p::Shutcuts("CS--P")

; CTRL+SHIFT+Q 
^+q::Shutcuts("CS--Q")

; CTRL+SHIFT+R 
^+r::Shutcuts("CS--R")

; CTRL+SHIFT+G 
^+s::Shutcuts("CS--G")

; CTRL+SHIFT+T 
^+t::Shutcuts("CS--T")

; CTRL+SHIFT+U 
^+u::Shutcuts("CS--U")

; CTRL+SHIFT+V 
^+v::Shutcuts("CS--V")

; CTRL+SHIFT+W 
^+w::Shutcuts("CS--W")

; CTRL+SHIFT+X 
^+x::Shutcuts("CS--X")

; CTRL+SHIFT+Y 
^+y::Shutcuts("CS--Y")

; CTRL+SHIFT+Z 
^+z::Shutcuts("CS--Z")

;**********

; CTRL+WIN+A
^*a::Shutcuts("C--WA")

; CTRL+WIN+B
^*b::Shutcuts("C--WB")

; CTRL+WIN+C
^*c::Shutcuts("C--WC")

; CTRL+WIN+D
^*d::Shutcuts("C--WD")

; CTRL+WIN+E
^*e::Shutcuts("C--WE")

; CTRL+WIN+F 
^*f::Shutcuts("C--WF")

; CTRL+WIN+G 
^*g::Shutcuts("C--WG")

; CTRL+WIN+H 
^*h::Shutcuts("C--WH")

; CTRL+WIN+I 
^*i::Shutcuts("C--WI")

; CTRL+WIN+J 
^*j::Shutcuts("C--WJ")

; CTRL+WIN+K 
^*k::Shutcuts("C--WK")

; CTRL+WIN+L 
^*l::Shutcuts("C--WL")

; CTRL+WIN+M 
^*m::Shutcuts("C--WM")

; CTRL+WIN+N 
^*n::Shutcuts("C--WN")

; CTRL+WIN+O 
^*o::Shutcuts("C--WO")

; CTRL+WIN+P 
^*p::Shutcuts("C--WP")

; CTRL+WIN+Q 
^*q::Shutcuts("C--WQ")

; CTRL+WIN+R 
^*r::Shutcuts("C--WR")

; CTRL+WIN+G 
^*s::Shutcuts("C--WG")

; CTRL+WIN+T 
^*t::Shutcuts("C--WT")

; CTRL+WIN+U 
^*u::Shutcuts("C--WU")

; CTRL+WIN+V 
^*v::Shutcuts("C--WV")

; CTRL+WIN+W 
^*w::Shutcuts("C--WW")

; CTRL+WIN+X 
^*x::Shutcuts("C--WX")

; CTRL+WIN+Y 
^*y::Shutcuts("C--WY")

; CTRL+WIN+Z 
^*z::Shutcuts("C--WZ")

rdllngr
Posts: 53
Joined: 22 Sep 2017, 09:39

Re: Shutcuts conflict

14 Feb 2019, 10:59

It's because the WinKey needs to be represented with a hashtag (#) instead of a wildcard (*).

Wildcard: Fire the hotkey even if extra modifiers are being held down. This is often used in conjunction with remapping keys or buttons.
#: Windows logo key.

Like this:

Code: Select all

; CTRL+WIN+C
^#c::Shutcuts("C--WC")

; OR
; *^#c::Shutcuts("C--WC")

Shutcuts(strTest)
	{
	msgbox "You have pressed " %strTest%
	}
Last edited by rdllngr on 14 Feb 2019, 12:36, edited 1 time in total.
Calvin
Posts: 37
Joined: 22 Jul 2016, 01:11

Re: Shutcuts conflict

14 Feb 2019, 12:07

Thanks !!!

Return to “Ask For Help”

Who is online

Users browsing this forum: g0ss, Google [Bot], lexikos, Odlanir, Tigerlily and 213 guests