Jump to content
Macro Express Forums

Key remapping


Recommended Posts

The Escape key is available as a hotkey for activating a macro in exactly the same way as any alphabetical key.

 

If you want to control this in an already running macro, then use code like this:

Wait for Key Press: ESC -- wait for up to 10 seconds
On Error
  Catch Error: The condition was not met within the specified amount of time
 Variable Set Bool bError to "True"
  End Catch Error
End Error
If Variable %bError% Equals "false" -- Esc key was pressed within 10 seconds
  Text Box Display: 
Else -- Esc key was not pressed within 10 seconds
  Text Box Display: 
End If

<WAIT FOR KEY PRESS Key="ESC" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="10" _HANDLE="0x0014"/>
<ON ERROR/>
<CATCH ERROR Code="20"/>
<VARIABLE SET BOOL Destination="bError" Command="263" Value="TRUE"/>
<END CATCH ERROR/>
<END ERROR/>
<IF VARIABLE Variable="%bError%" Condition="\x00" Value="false" IgnoreCase="FALSE"/>
<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Esc key was pressed\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="2" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
<ELSE/>
<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Esc key was not pressed\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="2" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
<END IF/>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...