Hi,
in this thread I wan't to show you, how an 'focusless, leaderless, targetless' - setup (ftl), can be implemented in HotKeyNet with the use of Templates , so that after you customized the templates you only need to add only one quite simple line for defining the hotstrings of an ftl-key!

(For the general Idea of the FTL see the wiki-entry or the sticky !)

First of all I like to say, that this is not all my thoughts alone, but I was mainly influenced/inspired by Freddie the author of HKN, while discussing the hole implemntation of the hole template-idea, and Anemo who implemented the first ftl-setup for HKN .

What I wan't to do here is simply give you the needed Templates, to create the keymaps/hotstrings, show you what they do and how you can use and customize them.

So first, the Template you copy in your hkn-file:

Templates:

Code:
//%1% : Master Key
// %2% : Slave Key
// %3% : Modifier
// %4% : SlavesToSend
<Template SendMasterAndSlave>
         <SendFocusWin>
                  <Key %1%>
         <Sendlabel %4%>
                  <Key %3% %2%>
<EndTemplate>

// %1% : master key
// %2% : slave key
// %3% : modifier
// %4% : Active window
// %5% : Slave Windows
<Template SendLeaderless>
        <If ActiveWinIs %4%>
            <ApplyTemplate SendMasterAndSlave "%1%" "%2%" "%3%" "%5%">
<EndTemplate>

// %1% : master-key
// %2% : slave-key
<Template FTL>
          <Hotkey %1%>     
                   <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl rshift" WoW1 "w2,w3,w4,w5">
                   <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl ralt" WoW2 "w1,w3,w4,w5">
                   <ApplyTemplate SendLeaderless "%1%" "%2%" "ralt rshift" WoW3 "w1,w2,w4,w5">
                   <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl ralt rshift" WoW4 "w1,w2,w3,w5">
                   <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl" WoW5 "w1,w2,w3,w4">          
<EndTemplate>

<Label w1 Local SendWinM WoW1>
<Label w2 Local SendWinM WoW2>
<Label w3 Local SendWinM WoW3>
<Label w4 Local SendWinM WoW4>
<Label w5 Local SendWinM WoW5>
Defining a ftl-key

To define a ftl key, which is activated by the master-key, and sends the master-key to the master and the slave-key plus the modifiers identifiing the master to the slave, you add the following line to your HKN file:

<ApplyTemplate FTL "master-key" "slave-key">

so for example the following would define ftl-keys:

<ApplyTemplate FTL "1" "u">
<ApplyTemplate FTL "lshift 1" "k">
<ApplyTemplate FTL "2" "lshift l">

...

Customizing the Templates

To get the Template working for your system you have to customize the following things:

1. Customize the Modifiers which identify the windows
2. Customize the Window-names
3. Customize the labes



The main work for defining the keys is done in the FTL-Template:
Code:
        // %1% : master-key
// %2% : slave-key
<Template FTL>
         <Hotkey %1%>     
                 <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl rshift" WoW1 "w2,w3,w4,w5">
                 <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl ralt" WoW2 "w1,w3,w4,w5">
                 <ApplyTemplate SendLeaderless "%1%" "%2%" "ralt rshift" WoW3 "w1,w2,w4,w5">
                 <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl ralt rshift" WoW4 "w1,w2,w3,w5">
                 <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl" WoW5 "w1,w2,w3,w4">          
<EndTemplate>
Here you can customize the modifiers which identify the WoW-windows.
For example: <ApplyTemplate SendLeaderless "%1%" "%2%" "rctrl rshift" WoW1 "w2,w3,w4,w5">
Means that the window named 'WoW1' is identified by the modifier combination 'rctrl rshift'.
Here you have to change the 'WoW1' to the actual name of the window and the "rctrl rshift" to the modifier you want to use for that window.

If you changed the names of the Windows (maybe to the names of your Charaters) you also have to change the name in the <Label>-definition for the window!

Voila, all customizing neccesary were done, and you are good to go!

And remember, once you have setup the templates correct, the only thing you have to do to add an leaderless-key is adding one line of <ApplyTemplate FTL "master-key" "slave-key"> to your hkn script, and do the ormal setup in wow !