Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Key Mapping

May
366
4
Hello everyone,

I use AutoHotKey to map keys which run AHK scripts. Works great. I have F12 mapped in AutoHotKey which works everywhere except if TCC (from withing TCMD) has the focus. AutoHotKey never gets the key press. I think TCC "eats" it.

To me, this makes sense if TCC has F12 mapped, but I've looked in TCC Options, and there is no direct key mapping to F12 that I can see. Any ideas on how this keypress can be passed along if the key is not mapped in TCC?

Thanks all,

Michael
 
AHK and F12 work OK here. According to TCC's help, the default assignment for F12 is "RepeatFile" (repeat the previous matching filename). Find the setting at OPTION ... Keyboard tab ...Tab Completion Category ... RepeatFile; mine is empty (probably done by me). You might also try
Code:
findstr F12 %_ininame
.
 
Thanks Vince. AHK works with my other defined hotkeys, just not F12.

Secondly, if I run tcc.exe directly, it works ok, but not if TCC is running under TCMD.

I don't have RepeatFile or anything mapped to F12 in the tcmd.ini file. Can you quickly check to see if you can map something to F12 in AHK and activate it while TCC has the focus when running within TCMD? I wonder if there is something special with F12.

Code:
Example with AutoHotKey v2: 

F12::msgbox("F12 Hit from AHK")

Thanks for the help.

Michael
 
Now I'm seeing it too ... not when TCC is in a console, but when TCC is in either TCMD or WindowsTerminal. I read somewhere that WindowsTerminal reserves F12 for something to do with debugging. I have no clue what's going on in TCMD.

FWIW, all my AHK hotkeys use Ctrl-Alt. I've never run into a problem.
 
Not sure if this has anything to do with your issue, so just passing it along.

From Creating and Using TCC Keystroke Aliases / Macros
After defining a keystroke alias, you may discover that it doesn't work because TCC reserves the key for some other purpose. If you tried the examples above, you will know that the @@F12 didn't work as expected; F12 has a minor filename-completion function. If you'd rather use a key for your own alias instead of its predefined function, you can“de-assign” it by adding a NormalKey= or NormalEditKey= directive to the TCMD.INI file. NormalKey= de-assigns a general input key, and NormalEditKey= de-assigns command-line editing keys. If you don't know which group a given key belongs to, you can simply use both directives — there's no harm in having both:

NormalKey=F12
NormalEditKey=F12

Joe
 
Thanks Joe. I did not know about this. I appreciate the comment.

However, it didn't seem to help in this circumstance. Given the AutoHotKey F12 assignment works in TCC standalone, but not in TCC under TCMD, it seems like it probably isn't a TCC configuration issue - at least to my thinking.

Michael
 
As a postscript to this, if you define your hotkey in AutoHotkey with the $ prefix, it uses a keyboard hook instead of registering it with RegisterHotKey(). This works successfully in TCC under TCMD.


Thank you for your help here.

Michael
 
As a postscript to this, if you define your hotkey in AutoHotkey with the $ prefix, it uses a keyboard hook instead of registering it with RegisterHotKey(). This works successfully in TCC under TCMD.


Thank you for your help here.

Michael
Hmmm! I read about RegisterHotKey and I'm very curious. If AHK is using RegisterHotKey() (no $ prefix) why would it fail if TCC has the foreground and work otherwise?

And even with the prefix, F12 fails in AHK if TCC is running in WindowsTerminal and WindowsTerminal has the foreground (it's OK in a console or TCMD).
 

Similar threads

Back
Top