Hello,
I'm using a tool called PhraseExpress to help me enter similar sentences using keyboard.
This tool shows a small popup containing text snippets that match my input.
Occasionnally, I need to discard the popup. I would like the Esc key to allow me to do this.
The issue without remapping the key is that Esc discards the popup but sends the Esc key to the host application.
I need Esc while popup is displayed to just discard the popup
The window characteristics of the popup are
ahk_class TexForm
ahk_exe phraseexpress.exe
I have written the below script but is doesn't work :
$Esc::
IfWinActive, ahk_class TExForm
{
;keystroke to discard the menu
SendInput, {Left}
}
Else
{
SendInput, {Esc}
}
return
Can someone help ?
Thanks
Remapping Esc key to discard a popup
Re: Remapping Esc key to discard a popup
What is the title on the popup? Use that title instead of ahk_class value.
Because the host application and the popup both might have the similar ahk_class and ahk_exe values.
What happens when you send {left}?
Do you also have to send {enter}? (I'm assuming there is an "OK" button that needs to be clicked)
Because the host application and the popup both might have the similar ahk_class and ahk_exe values.
What happens when you send {left}?
Do you also have to send {enter}? (I'm assuming there is an "OK" button that needs to be clicked)
Re: Remapping Esc key to discard a popup
Actually the popup has no title. Just a list of corresponding text snippets.
{left} discards the popup
{Enter] chooses the selected entry
There is no OK button
Attached is a sample (French text) -Pierre
{left} discards the popup
{Enter] chooses the selected entry
There is no OK button
Attached is a sample (French text) -Pierre
Re: Remapping Esc key to discard a popup
Try removing the "$" sign at the start of your code.
Also try "Winactivate, ahk_class TExForm".
Also try "Winactivate, ahk_class TExForm".
Code: Select all
Esc::
IfWinActive, ahk_class TExForm
{
;keystroke to discard the menu
Winactivate, ahk_class TExForm
SendInput, {Left}
}
Else
{
SendInput, {Esc}
}
return
Re: Remapping Esc key to discard a popup
Does someone have a suggestion on how to detect that strange popup ?
Re: Remapping Esc key to discard a popup
I use SciTE4AutoHotkey
it has a "Active Window Info" program that gives you these info
http://fincs.ahk4.net/scite4ahk/
it has a "Active Window Info" program that gives you these info
http://fincs.ahk4.net/scite4ahk/
Re: Remapping Esc key to discard a popup
Thanks. Looks basically the same as Windows Spy included in AutoHotkey. That didn't help much more. Sorry
Re: Remapping Esc key to discard a popup
Any other idea, anyone, on how catch that bloody popup ? Thanks
The WindowProbe script gives :
Unique ID: ahk_id 0x41664
Title:
Class: ahk_classTExForm
Control:
Active Control:
Does someone has an idea to know whether the popup is displayed (or hidden), and how to discard it (giving it focus and typing {left}) ?
The WindowProbe script gives :
Unique ID: ahk_id 0x41664
Title:
Class: ahk_classTExForm
Control:
Active Control:
Does someone has an idea to know whether the popup is displayed (or hidden), and how to discard it (giving it focus and typing {left}) ?
Re: Remapping Esc key to discard a popup
The following code works ...
$Esc::
Sleep, 100 ; 1 second
uid = WinExist(""ahk_class TExForm")
If uid
{
WinActivate, ahk_id %uid%
SendInput, {Left}{Right}
}
Else
{
SendInput, {Esc}
}
return
... however, the next issue is t popup is always found (whether visible or not). So when the popup is not visible the {Esc} key is never sent.
Help !
PS: I have Detecthiddenwindows to off
$Esc::
Sleep, 100 ; 1 second
uid = WinExist(""ahk_class TExForm")
If uid
{
WinActivate, ahk_id %uid%
SendInput, {Left}{Right}
}
Else
{
SendInput, {Esc}
}
return
... however, the next issue is t popup is always found (whether visible or not). So when the popup is not visible the {Esc} key is never sent.
Help !
PS: I have Detecthiddenwindows to off
Re: Remapping Esc key to discard a popup
Does someone know about a trick to determine whether the popup is actually visible on screen ?
Apparently WinExist() is not reporting whether it's visible or not.
Apparently WinExist() is not reporting whether it's visible or not.
Re: Remapping Esc key to discard a popup
Seems I'm alone or no one is interested... Sigh
Re: Remapping Esc key to discard a popup
is your code at the end of the script ?
try placing the code at the start or your script or before the popup appears
try placing the code at the start or your script or before the popup appears
Re: Remapping Esc key to discard a popup
Not an answer to your question but why use such a program when AutoHotkey can also send texts via hotstrings, hotkeys and menus?
AHK alternatives: AutoComplete, TypingAid and Lintalist may be of interest, see https://github.com/ahkscript/awesome-AutoHotkey#typing
and intellisense everwhere https://autohotkey.com/boards/viewtopic.php?f=6&t=45684 - a TypingAid fork by the looks of it
AHK alternatives: AutoComplete, TypingAid and Lintalist may be of interest, see https://github.com/ahkscript/awesome-AutoHotkey#typing
and intellisense everwhere https://autohotkey.com/boards/viewtopic.php?f=6&t=45684 - a TypingAid fork by the looks of it
Lintalist: website - source (github)
Re: Remapping Esc key to discard a popup
@list: Thanks will have a look ! Just a comment that the tool I'm using (phraseexpress.exe) auto learns the frequently typed snippets. Do you know about a script that does same ?
@hymal7: Code is at the beginning of script
@hymal7: Code is at the beginning of script
Re: Remapping Esc key to discard a popup
TypingAid will learn words (if I understood it correctly)
typingaid wrote:The script will learn words as you type them if "Learn new words as you type" is set to On in Settings. If you type a word more than 5 times (or as defined in "Minimum length of word to learn") in a single session the word will be permanently added to the list of learned words. Learned words will always appear below predefined words, but will be ranked and ordered among other learned words based on the frequency you type them.
Lintalist: website - source (github)
Re: Remapping Esc key to discard a popup
Thanks for advice.
Actually the issue is solved since the PE editor improved the popup to have Esc dismiss the dialog.
However, I'm frustrated not to know how to do this using AHK.
Thanks all !
Actually the issue is solved since the PE editor improved the popup to have Esc dismiss the dialog.
However, I'm frustrated not to know how to do this using AHK.
Thanks all !
Who is online
Users browsing this forum: LeafyWater and 146 guests