Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2002
    Location
    CT, NY
    Posts
    38

    Grin Use the keyboard to execute actions

    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.

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843

    Re: Use the keyboard to execute actions

    very easy.
    any button (visible or not) has a hotkey feature. If you want just the hotkey, make the button (can be a hotspot) 1 pixel big so it cannot be seen.
    Good luck
    Yossi

  3. #3
    Join Date
    Jul 2000
    Location
    NY
    Posts
    332

    Re: Use the keyboard to execute actions

    You can even move the hotspot outside of the page boundaries if you don't even one the 1pixel x 1 pixel element to be clickable. The Shorcut for the projecthotspot will still work.

  4. #4
    Join Date
    Aug 2002
    Location
    CT, NY
    Posts
    38

    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?

  5. #5
    Join Date
    Jul 2000
    Location
    NY
    Posts
    332

    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.

    http://www.delphicollection.com/publ...KeyCodes.shtml

    Make sure you look at the decimal number and not the hexadecimal.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts