Ctrl+Alt shortcut activates AltGr?
Ctrl+Alt shortcut activates AltGr?
Apologies if this is a FAQ, it feels like one,but I could not find an answer.
In my .ahk I have a shortcut setup for Ctrl+ALt+a:
^!a::SEND my text
However, when I press AltGr+a to get á it activates the same shortcut.
Why is this? How can I stop it happening?
In my .ahk I have a shortcut setup for Ctrl+ALt+a:
^!a::SEND my text
However, when I press AltGr+a to get á it activates the same shortcut.
Why is this? How can I stop it happening?
Re: Ctrl+Alt shortcut activates AltGr?
Code: Select all
<^>!a::Send á
^!a::Send my text
Last edited by mikeyww on 22 Jul 2021, 10:04, edited 1 time in total.
Re: Ctrl+Alt shortcut activates AltGr?
Really. I had no idea. Every day is a school day.
Re: Ctrl+Alt shortcut activates AltGr?
My main shortcuts are F10 based but I had run out, it would not allow me to do Ctrl+F10+a for some reason so I tried that
Re: Ctrl+Alt shortcut activates AltGr?
Here you can type the A shortly after releasing Ctrl+F10.
Code: Select all
str := {a: "my text", b: "your text"}
$^F10::
Input, key, L1T.6
SendInput % str.HasKey(key) ? "{Text}" str[key] : "^{F10}"
Return
Re: Ctrl+Alt shortcut activates AltGr?
interesting. How do I use that? It looks like a method. I tried including the body and also the the function name is it (CODE: SELECT ALL - TOGGLE LINE NUMBERS)
Re: Ctrl+Alt shortcut activates AltGr?
Paste the text into a new file called "test.ahk". Omit the "CODE" line; that is just part of the online forum itself. Run the script. See the green "H" icon in the Windows system tray. Open & activate Notepad. Press Ctrl+F10 followed by A within 0.6 seconds.
Alternative script:
You run this script. In notepad, type F A Space. Use lower-case letters here.
Alternative script:
Code: Select all
:CT:fa::my text
Re: Ctrl+Alt shortcut activates AltGr?
The alternative script is interesting and works for me. Sticking with my long used F10 shortcuts, the first thing I tried was copying the five lines into my single script file, minus the "header". The return threw me which is why I posted about a function. Including the 4 lines or the 5 lines with the return in my script do not work for me....in notepad it does highlight File for some reason
Re: Ctrl+Alt shortcut activates AltGr?
The Ctrl+F10 is sent-- highlighting "File"-- if you do not press A within 0.6 seconds. In any case, if you have a bunch of different text strings to send, then using hotstrings is simple and convenient. It also prevents you from having to memorize various hotkeys, as long as you know the hotstring triggers, which are often easier to remember.
Re: Ctrl+Alt shortcut activates AltGr?
I'm not following you re the text snippets being easier. I have used F10+e for email address for 10+ years, similarly for a bunch of others, easy to remember. I want to add a control as I need to double up on one letter. the a is not recognised after the ctrl+f10 for me, unfortunately.
Re: Ctrl+Alt shortcut activates AltGr?
So you tested my script with no other code in it, and no other scripts running at the same time? You can increase the timeout (T.6) to something like T1 or T2.
Re: Ctrl+Alt shortcut activates AltGr?
No, I have my own ahk file, I want to include your script in it, surely that's possible? I don't know how to have 2 .ahk files, do I need to have?
Re: Ctrl+Alt shortcut activates AltGr?
One script is fine. Since I cannot see what you are doing with the other script, I cannot advise you much, but you will need the str array definition at the top of the script.
Re: Ctrl+Alt shortcut activates AltGr?
I have your script posted verbatim in lines 48-52 of my script...unsure why I would need to move str to line #1?
Re: Ctrl+Alt shortcut activates AltGr?
Because the variable str must be initialized for the hotkey to work correctly.
But you could also move the line below the line $^F10::, then the initialization of str is executed everytime the hotkey is triggered, if you don't wnat to move the line to the top of the script.
But you could also move the line below the line $^F10::, then the initialization of str is executed everytime the hotkey is triggered, if you don't wnat to move the line to the top of the script.
Re: Ctrl+Alt shortcut activates AltGr?
Moving str definition below means it all works now Thanks!
Does the return match the $ ?
Does the return match the $ ?
Re: Ctrl+Alt shortcut activates AltGr?
I get it, thanks so much Totally sorted now.