Jump to content

Recommended Posts

Posted

Hi All!

Using XML file:

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<binding>
<key>a</key>
<string>This is the first string</string>
</binding>
<binding>
<key>b</key>
<string>This is the second string</string>
</binding>
<binding>
<key>c</key>
<string>This is the first string</string>
</binding>
</keymap>

key 'a' maps to 'This is the first string' and so on. I have managed to parse the xml file into a 2d array as seen below

_XMLFileOpen("list.xml")
   Local $iCount = _XMLGetNodeCount("/keymap/binding")  
   Local $bindings[$iCount+1][2]
      
   For $i = 1 to $iCount
      
      $bindings[$i][0] = _XMLGetFirstValue("/keymap/binding[" & $i & "]/key")
      $bindings[$i][1] = _XMLGetFirstValue("/keymap/binding[" & $i & "]/string")      
      
   Next

What I'm trying to accomplish is not having to write a unque function for each key press. It's impossible to do so when I wont know the contents of the XML file. Are dynamic functions possible?

Any advice on how to map key input as defined in the XML file would be great!

My only lead right now is using HotKeyPress, however it dosn't accept paramaters so I dont know how one would sync it up to a dynamic XML list.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...