Creating Clickable URLs in TTWin

A small but very useful feature available in our Windows terminal emulator TTWin is the ability to automatically convert web address text appearing on your host terminal into clickable buttons that open the address in a web browser.

a text URL transformed into a clickable button which launches a browser

A text URL transformed into a clickable button which launches the system default browser.

This feature is part of TTWin's Hotspot tool. A Hotspot is a dynamically created button which is overlaid on the terminal screen and triggers a user defined event when clicked. Hotspots are dynamically generated and can be configured to match terminal text and overlay known content or they can be configured to display in fixed positions. They're very handy for adding a layer of mouse interaction to what would otherwise be an entirely text driven environment.

This article doesn't go through the entire Hotspot creation process, for full details on creating and editing hotspots look to the Hotspots chapter of the TTWin 4 User Guide. A copy of the user guide is included with all free trial downloads and licensed installations of TTWin 4.

For the sake of example, let's say the text that appears in your host application and that you want to turn into a clickable button is 'www.ttwin.com'. We'll assume you've already defined your Hotspot to match that text as it appears on your host screen and you're now ready to define the action that Hotspot performs when clicked. So, after selecting Configure > Hotspots > New (or Edit) and setting the String to Match.. text, here are the steps to follow to have that Hotspot open www.ttwin.com in a web browser.

 Create a clickable URL link in TTWin
  1. Under the Send String option click the ... button to open the Macro Assistant
  2. Click Insert After to add a new macro action.
  3. Select Function from the drop list
  4. Select HotSpotURL from the list of available functions.
  5. Click OK and save your HotSpot.

Now, when TTWin is connected to a host system and the text www.ttwin.com appears on screen it will be converted to a clickable button. Clicking that button opens the system's default browser to the page https://www.ttwin.com.

A point to remember is that the host text you are using should be a text string prefixed with either www., https:// or https:.// such as https://www.ttwin.com, https://www.ttwin.com or www.ttwin.com. Partial addresses like ttwin.com are not acceptable.

Advanced Usage - Adding a wildcard to make EVERY link clickable

A useful trick to make every link that appears on your terminal display clickable is to add a wildcard to the Hotspot match string. To do this follow these steps:

  Make a clickable button for every web address
  1. Select Configure > Hotspots > New (or Edit) to access the Hotspot configuration
  2. In the String to Match.. textbox enter https://* (Note the asterisk at the end!)
  3. Enter a single space in both the Pre Char and Post Char textboxes
  4. Check the box labelled Wildcards
  5. Click OK

Configure the rest of the Hotspot including Send String settings as before.

Now, when connected to a host system, every instance of text prefixed with https:// will be converted to a clickable button that, when clicked, will open a web browser to the underlying URL.

|