Hi, first, thanks for your time on this post.
I'm using AutoHotKey v1.1.22.09 on Windows 10, in a computer-aided translation software Trados Studio 2014.
I want to perform a shortcut operation which includes the following two steps:
1) display the menu with quick access keys, which is similar to physically pressing the Alt key on the keyboard. The expected result of sending {Alt} is attached to the post.
2) after this menu is displayed, I can "Send H", "Send U", and then "Send A" to implemented the required function.
However, I was stuck in step 1): AutoHotKey refused to send {Alt}, or if it did send {Alt}, it must have done it in a different way, because no menu is displayed.
I tried the following in the hope of simulating the physically pressing the Alt key to display the menu:
^[::Send {Alt}
^[::Send !
^[::Send Alt
None of these provide the expected result. Did I do something wrong, as a new AutoHotKey user does, or is there any suggestion?
Thanks again.
AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
- Attachments
-
- 2016-1-13 9-04-47.png
- Expected display after sending {Alt}
- (5.21 KiB) Downloaded 82 times
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
"Alt" does not actually exist as a key - "Left Alt(LAlt)" and "Right Alt(RAlt)" exist as keys.
Trying to send Alt without a left or right variant may not do what you want.
Furthermore, if you wish to send a combination of ALT and other keys, there is a better way to do that.
To send ALT+F, try: Send !f
To send ALT on it's own, try Send {LAlt}
You shouldn't need to send ALT on it's own though, if you wish to open the "File" menu, just Send !f should do it fine - you should not need to wait for the menu to appear.
Trying to send Alt without a left or right variant may not do what you want.
Furthermore, if you wish to send a combination of ALT and other keys, there is a better way to do that.
To send ALT+F, try: Send !f
To send ALT on it's own, try Send {LAlt}
You shouldn't need to send ALT on it's own though, if you wish to open the "File" menu, just Send !f should do it fine - you should not need to wait for the menu to appear.
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
Hi evilC, thanks a lot for your message.
Yes, I should directly Send !f (in my case, it's Send !h). Send !h worked in many software, including Total Commander, Chrome browser, and the like. This means that the keystroke is correct and should work properly.
However, unfortunately, I did not get the expected result in the specific software that I need - Trados Studio. Maybe it is not a problem of AutoHotKey, but one related to Trados Studio, or a problem of compatibility between the two. I guess I have to take it as it is. How I wish there will be a workaround for this, no matter though Trados Studio or through AutoHotkey.
Yes, I should directly Send !f (in my case, it's Send !h). Send !h worked in many software, including Total Commander, Chrome browser, and the like. This means that the keystroke is correct and should work properly.
However, unfortunately, I did not get the expected result in the specific software that I need - Trados Studio. Maybe it is not a problem of AutoHotKey, but one related to Trados Studio, or a problem of compatibility between the two. I guess I have to take it as it is. How I wish there will be a workaround for this, no matter though Trados Studio or through AutoHotkey.
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
Is Trados Studio recognizing any of the keys you send, or is it only a problem with ALT?
Try adding SetKeyDelay, 0, 50 to the start of the script.
Try running the script as admin.
Try adding SetKeyDelay, 0, 50 to the start of the script.
Try running the script as admin.
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
Hi evilC, thanks for your reply.
Yes, Trados Studio recognizes other keys, including +{F10} to display the shortcut menu, MouseMove to move to a function icon, {Click}, {Enter}, and some others. These are the keys I use because {Alt} is unavailable to activate the shortcut menu. Currently, I only have the Alt problem on Trados Studio.
I tried SetKeyDelay and running as administrator, but {Alt} or !h still does not respond in Trados Studio.
But still thank your for your suggestions.
Yes, Trados Studio recognizes other keys, including +{F10} to display the shortcut menu, MouseMove to move to a function icon, {Click}, {Enter}, and some others. These are the keys I use because {Alt} is unavailable to activate the shortcut menu. Currently, I only have the Alt problem on Trados Studio.
I tried SetKeyDelay and running as administrator, but {Alt} or !h still does not respond in Trados Studio.
But still thank your for your suggestions.
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
^[::Send {Alt} will not work in most applications because you are still holding the Ctrl key. Manually pressing Ctrl+Alt does not activate the menus either. Send automatically releases the hotkey's modifiers when you send a non-modifier key, but it does not do this for a modifier key on its own, such as {Alt} or {Alt down/up}.
It looks like Trados Studio uses the Ribbon Framework, similar to Word 2010 and WordPad (in Windows 7 at least). The following works on Word and WordPad, but it's possible that Trados Studio handles keyboard input differently, or that Word and WordPad don't use the same/public version of the Ribbon Framework.^[::Send !f also works in Word and WordPad, but we know Send !h does not work in Trados Studio. Have you tested it with a different hotkey, or without a hotkey (e.g. after WinActivate)?
It looks like Trados Studio uses the Ribbon Framework, similar to Word 2010 and WordPad (in Windows 7 at least). The following works on Word and WordPad, but it's possible that Trados Studio handles keyboard input differently, or that Word and WordPad don't use the same/public version of the Ribbon Framework.
Code: Select all
^[::
KeyWait Ctrl
Send {Alt}
return
There are three virtual keys: VK_LMENU, VK_RMENU and VK_MENU. Alt and ! for a hotkey and Alt for KeyWait mean any of the three, but Send {Alt} is equivalent to Send {LAlt}.evilC wrote:"Alt" does not actually exist as a key - "Left Alt(LAlt)" and "Right Alt(RAlt)" exist as keys.
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
Hi lexikos,
Thank you so much.
This script did the work. This activates the ribbon and shows the shortcut "H" that I'm eager to have.
With this working, I can customizing many shortcut functions in Trados Studio, which is a very popular computer-aided translation (CAT) application. I saw other people in some translation forums are puzzled by this problem. I believe they will be as happy as me if they find this post.
Thank you so much.
Code: Select all
^[::
KeyWait Ctrl
Send {Alt}
return
With this working, I can customizing many shortcut functions in Trados Studio, which is a very popular computer-aided translation (CAT) application. I saw other people in some translation forums are puzzled by this problem. I believe they will be as happy as me if they find this post.
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
I know this thread is old, but I would like to complete the answer, because with some configurations it doesn't work as expected (in my case: when using Windows with a Steam Link).
First it's useful to make a function to be sure all keys are released (I use this one for all my hotkeys):
Then to use a ribbon shortcut, this should usually work:
(exemple for the ribbon shortcut in Word for creating a bullet list : alt l k right right enter)
And as I said above, if this doesn't work for you, the trick I found is to replace {alt} by !{space}{alt}{alt}. This actually force the focus on the current window, like this:
Hope this could help those who still need
First it's useful to make a function to be sure all keys are released (I use this one for all my hotkeys):
Code: Select all
waitRelease() {
KeyWait Control
KeyWait Shift
KeyWait Alt
}
(exemple for the ribbon shortcut in Word for creating a bullet list : alt l k right right enter)
Code: Select all
!^+b::
waitRelease()
Send {alt}lk{right}{right}{enter}
return
Code: Select all
!^+b::
waitRelease()
Send !{space}{alt}{alt}lk{right}{right}{enter}
return
Re: AutoHotKey refused to send Alt, which is supposed to display the menu with shortcuts
I have corrected the code in the post above to remove the incorrect use of braces and terminate the hotkey subroutines with return.
This is a remapping, not a hotkey: !^+b::{
Braces should not be used with hotkeys or labelled subroutines, as they generally have no effect (other than to mislead the reader/author).
This is a remapping, not a hotkey: !^+b::{
Braces should not be used with hotkeys or labelled subroutines, as they generally have no effect (other than to mislead the reader/author).
Who is online
Users browsing this forum: Bing [Bot] and 336 guests