Hello there!
I have a spanish windows 10 that uses different shortcuts from english version. For "select all" it uses ctrl+E instead of standard ctrl+A. But I have other applications that use the regular ctrl+A. For example, if I am in the desktop and hit ctrl+E all the items in the desktop will be selected. But if I am using application "X" and I want to select all I have to use ctrl+A.
I want to be able to use only ctrl+A, I have tried to solve this using autohotkey. I think that behaviour should be: when I press ctrl+A -> send ctrl+a and send ctrl+e
I have tried the following:
^a::
Send {^a}
Send {^e}
return
With this script in windows it works but in other apps it does not. What am I doing bad???
Convert ctrl+a to (ctrl+e + ctrl+a) Topic is solved
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
Try without {}
^a::
Send ^a
Send ^e
return
^a::
Send ^a
Send ^e
return
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
Thanks for suggesting! I have tried: when I press ctrl+a the system starts to behave like if the keys ctrl+a or ctrl+e were pressed many times and all the time...
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
i think you are going to run into problems if you try to send both sequences
according to this page, CTRL+A is "open" for spanish MS Word:
https://social.technet.microsoft.com/Fo ... progeneral
probably the better idea is to use context sensitive hotkeys and only remap CTRL+A or CTRL+E in certain applications
according to this page, CTRL+A is "open" for spanish MS Word:
https://social.technet.microsoft.com/Fo ... progeneral
probably the better idea is to use context sensitive hotkeys and only remap CTRL+A or CTRL+E in certain applications
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
I agree with guest3456
If you don't know what is "context sensitive" search #ifwinactive in autohotkey tutorial
If you don't know what is "context sensitive" search #ifwinactive in autohotkey tutorial
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
Thanks for the replies! I am investigating #ifwinactive option...
Anyway I would like to understand why when I try without { } the action is repeated continuously. This will help me to understand how AHK scripts work...
The only "application" that I have in spanish is Windows, all other programs are in English and use ctrl+a, so I really would like to give a try to my original idea to see if after that really arise other problems or not... So... what is the "correct" way to send two key combinations with AHK? Introducing a little delay between ctrl+a and ctrl+e would help?
Anyway I would like to understand why when I try without { } the action is repeated continuously. This will help me to understand how AHK scripts work...
The only "application" that I have in spanish is Windows, all other programs are in English and use ctrl+a, so I really would like to give a try to my original idea to see if after that really arise other problems or not... So... what is the "correct" way to send two key combinations with AHK? Introducing a little delay between ctrl+a and ctrl+e would help?
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
Well, I found a solution that is working for me:
SetKeyDelay , 30, 30 ; first is delay between keypresses, and second is press duration
^a::
; we are using ControlSend here because Send and SendInput is not affected by SetKeyDelay.
ControlSend, , ^a, A
ControlSend, , ^e, A
return
But instead this does nothing:
SetKeyDelay , 30, 30 ; first is delay between keypresses, and second is press duration
^a::
; we are using ControlSend here because Send and SendInput is not affected by SetKeyDelay.
ControlSend, , {^a}, A
ControlSend, , {^e}, A
return
Could someone clarify why the curly brackets cause different behaviour in those two scripts?
SetKeyDelay , 30, 30 ; first is delay between keypresses, and second is press duration
^a::
; we are using ControlSend here because Send and SendInput is not affected by SetKeyDelay.
ControlSend, , ^a, A
ControlSend, , ^e, A
return
But instead this does nothing:
SetKeyDelay , 30, 30 ; first is delay between keypresses, and second is press duration
^a::
; we are using ControlSend here because Send and SendInput is not affected by SetKeyDelay.
ControlSend, , {^a}, A
ControlSend, , {^e}, A
return
Could someone clarify why the curly brackets cause different behaviour in those two scripts?
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
see the Send help page. the {brackets} are only supposed to be used for special character such as {Enter}
and the reason why the action was repeated continuously was because you were in an endless loop:
you would need to use the $ modifier so that the Send command doesn't trigger its own hotkey. as in $^a::
see the Hotkeys help page for the $ modifier:
https://autohotkey.com/docs/Hotkeys.htm
still, i don't think you should send both sequences, its a bad idea. if "windows" is the only thing that uses CTRL+E, then i'd get very specific as to what instances you are using it: you mentioned on the desktop, what about in the File Explorer windows? is it only when you want to select all files? what about MS Office apps?
and the reason why the action was repeated continuously was because you were in an endless loop:
Code: Select all
^a::
Send, ^a ; this causes the hotkey to trigger itself and restart at the line above
return
see the Hotkeys help page for the $ modifier:
https://autohotkey.com/docs/Hotkeys.htm
still, i don't think you should send both sequences, its a bad idea. if "windows" is the only thing that uses CTRL+E, then i'd get very specific as to what instances you are using it: you mentioned on the desktop, what about in the File Explorer windows? is it only when you want to select all files? what about MS Office apps?
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
Hello,
I have had the time to investigate further the use of IfWinActive. Sorry for the delay.
I have tried:
Option 1:
if WinActive("ahk_class IEFrame")
^a::^e
Option 2:
IfWinActive, Compatibility Mode ahk_class IEFrame
{
^a::^e
return
}
Both options give same behaviour: this works well when an explorer windows has the focus, but in the other apps (that should ignore the script) CTRL+a is ignored and they receive CTRL+e instead...
Why?
I am also not sure if it is mandatory to put the "return" at the end, in both options.
I have had the time to investigate further the use of IfWinActive. Sorry for the delay.
I have tried:
Option 1:
if WinActive("ahk_class IEFrame")
^a::^e
Option 2:
IfWinActive, Compatibility Mode ahk_class IEFrame
{
^a::^e
return
}
Both options give same behaviour: this works well when an explorer windows has the focus, but in the other apps (that should ignore the script) CTRL+a is ignored and they receive CTRL+e instead...
Why?
I am also not sure if it is mandatory to put the "return" at the end, in both options.
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
for context sensitive hotkeys, you want #IfWinActive not IfWinActive
Code: Select all
#IfWinActive, Compatibility Mode ahk_class IEFrame
^a::^e
#IfWinActive ; this turns off #IfWinActive below here
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
It seems that your suggestion does not work for me, in explorer windows CTRL+A does nothing and CTRL+E selects all (normal behaviour)
I copy here all my script because I also have other shortcuts and I don't know if there can be some kind of interference:
; select all:
#IfWinActive, Compatibility Mode ahk_class IEFrame
^a::^e
#IfWinActive ; this turns off #IfWinActive below here
; canvi d'escriptori amb el teclat:
LWin & Right::
RWin & Right::
Send, {AltDOWN}{LWinDOWN}{Right}{LWinUP}{AltUP}
return
LWin & Left::
RWin & Left::
Send, {AltDOWN}{LWinDOWN}{Left}{LWinUP}{AltUP}
return
I copy here all my script because I also have other shortcuts and I don't know if there can be some kind of interference:
; select all:
#IfWinActive, Compatibility Mode ahk_class IEFrame
^a::^e
#IfWinActive ; this turns off #IfWinActive below here
; canvi d'escriptori amb el teclat:
LWin & Right::
RWin & Right::
Send, {AltDOWN}{LWinDOWN}{Right}{LWinUP}{AltUP}
return
LWin & Left::
RWin & Left::
Send, {AltDOWN}{LWinDOWN}{Left}{LWinUP}{AltUP}
return
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
Dear Guest3456,
Some weeks ago I tried your suggestion (to use #IfWinActive instead of IfWinActive) and in explorer windows CTRL+A does nothing and CTRL+E selects all (normal behaviour)
Do you know why?
#IfWinActive, Compatibility Mode ahk_class IEFrame
^a::^e
#IfWinActive ; this turns off #IfWinActive below here
Some weeks ago I tried your suggestion (to use #IfWinActive instead of IfWinActive) and in explorer windows CTRL+A does nothing and CTRL+E selects all (normal behaviour)
Do you know why?
#IfWinActive, Compatibility Mode ahk_class IEFrame
^a::^e
#IfWinActive ; this turns off #IfWinActive below here
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
I would guess that the #IfWinActive is not triggering.
Try running this script:
If running that doesn't cause a messagebox to pop up, then the problem is "Compatibility Mode ahk_class IEFrame" is not correctly detecting the window you want it to. Try changing that line to different things until you can get the messagebox to appear - don't forget you can use Window Spy to get the class names for windows.
Try running this script:
Code: Select all
#IfWinActive, Compatibility Mode ahk_class IEFrame
^a::
Msgbox, Working!
^e
#IfWinActive
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
I have followed your suggestions, and it seems I have gone a step forward, but it is still not enough!
Active window info shows:
When in an explorer window:
ahk_class CabinetWClass
ahk_exe explorer.exe
When in the desktop:
ahk_class WorkerW
ahk_exe explorer.exe
(I am using windows 10)
Having in mind this info I have tried following scripts:
#IfWinActive, Compatibility Mode ahk_class WorkerW
^a::
Msgbox, Working!
^e
#IfWinActive
and
#IfWinActive, Compatibility Mode ahk_class CabinetWClass
^a::
Msgbox, Working!
^e
#IfWinActive
None of these work. It seems IfWinActive is still not triggering.... even fi now the class names seem ok...
Active window info shows:
When in an explorer window:
ahk_class CabinetWClass
ahk_exe explorer.exe
When in the desktop:
ahk_class WorkerW
ahk_exe explorer.exe
(I am using windows 10)
Having in mind this info I have tried following scripts:
#IfWinActive, Compatibility Mode ahk_class WorkerW
^a::
Msgbox, Working!
^e
#IfWinActive
and
#IfWinActive, Compatibility Mode ahk_class CabinetWClass
^a::
Msgbox, Working!
^e
#IfWinActive
None of these work. It seems IfWinActive is still not triggering.... even fi now the class names seem ok...
Re: Convert ctrl+a to (ctrl+e + ctrl+a)
Remove "Compatibility Mode" as I doubt that it is part of the explorer windows title/class.
If the hotkeys don't work the #If.. is just incorrect, adjust it to make it work.
If the hotkeys don't work the #If.. is just incorrect, adjust it to make it work.
Re: Convert ctrl+a to (ctrl+e + ctrl+a) Topic is solved
Removing "Compatibility Mode" did the trick! Finally the script works as I expect: many thanks to the community!!! I am happy
The final script for reference:
#If WinActive("ahk_class CabinetWClass") || WinActive("ahk_class WorkerW")
^a::^e
#IfWinActive ; this turns off #IfWinActive below here
This script converts CTRL+A to CTRL+E in explorer windows and desktop (win 10)
The final script for reference:
#If WinActive("ahk_class CabinetWClass") || WinActive("ahk_class WorkerW")
^a::^e
#IfWinActive ; this turns off #IfWinActive below here
This script converts CTRL+A to CTRL+E in explorer windows and desktop (win 10)
[SOLVED] Re: Convert ctrl+a to (ctrl+e + ctrl+a)
I just marked the topic as solved.
Who is online
Users browsing this forum: Google [Bot] and 350 guests