Is there a way to have a key stroke execute an action. I would like it when the user hits the esc key, the application will end.
Announcement
Collapse
No announcement yet.
Use the keyboard to execute actions
Collapse
X
-
Re: Use the keyboard to execute actions
Great thanks for your help. I figured it out. I always wondered what that did. I have a problem though. I want to be able to hit escape and have the app quit. When I click in the shortcut box and hit escape, the properties window closes. Can esc be used as a shortcut?
Comment
-
Re: Use the keyboard to execute actions
Yes but you will need to edit the XML .AM4 file in WordPad or a text editor.
Find your object in the code by searching for the object name and change the virtual key number to 27. This is the Decimal Virtual Key number that represents the Esc key.
Here is an example of a hotspot named "Hotspot1" that I changed the key to ESC:
<Name>Hotspot1</Name>
<VisibleAtDesignTime>1</VisibleAtDesignTime>
<VisibleAtRunTime>1</VisibleAtRunTime>
<Locked>0</Locked>
<LockSize>0</LockSize>
<ToolTip/>
<Cursor>1</Cursor>
<Coordinates>
<Top>259</Top>
<Bottom>309</Bottom>
<Left>358</Left>
<Right>458</Right>
</Coordinates>
<Hotkey>
<VirtualKey>27</VirtualKey>
For a list of the decimal representations of the virtual keys you can check out this site.
Make sure you look at the decimal number and not the hexadecimal.
Comment
Comment