Direct Infrared Remote Control with AHK, Version 1.1 released 6/18/12
WinLIRC No longer needed.
After a lot a trial and error and a tremendous amount of patience I was able to follow what had been started by Laszlo, cynopsys and Thracx,
and complete (almost) a library for all the functions of the USB-UIRT IR transceiver.
Use the IR button code from any remote as labels in your scripts.
Transmit IR from your computer to control anything that has it's own remote control.
Learn IR codes from your remotes or download codes from the internet.
IR labels can be used in any script simply by calling the library function in the auto execute section. IR codes captured with USB-UIRT are suitable to copy and paste directly into your scripts as labels making direct control of any subroutine possible using any IR remote control.
The library contains all available USB-UIRT functions, example scripts of every function and the original developers notes.
View/download it here.
Temporary link while ahk.net is down.
Version 1.1 updates
1. Added USBUIRT_Abort(LearnPID) as a means to abort the learn processes.
2. Added a repeat parameter when transmitting IR codes. USBUIRT_SendIRRaw(IRCode,RepeatCount=1)
3. Corrected mistakes and typos suggested by wtg, thank you.
4. Updated many of the example scripts.
5. Removed seemingly unnecessary get/set batchlines/windelay.
This is not only my first attempt at accessing a dll but also my first attempt at creating a library so I'm sure there will be several things that could be improved upon. There are
To learn how to use IR codes as labels see the example script "Receiving IR". IR for use as labels does not need to be learned, just point your remote at the transceiver and press a button. The IR code is copied into the top edit box. Copy your IR code in place of the code in the labels at the bottom of the script. It's that simple.
The "Almost" part. There are
1 - Getting the return of the receive IR function. The return is not needed to use IR codes as labels. Edit, removed the temporary workaround in the library. Replaced the example script with one script that demonstrates using IR codes as labels and another that captures the IR codes. The capture script contains the needed functions and does not call the library.
2 - The learn progress function is not operational, no way to tell if the learn is progressing.
If anyone can assist in getting these two things functioning I would greatly appreciate it. Suggestions for improvements are also welcome. I also have no way of knowing if I am correctly getting the return of "User Data" other than assigning a string to the variable and making sure it gets copied to the edit box.
Edit, just found another bug. When first ran ConfigInfo returns a value of 19 when it looks as if it should only return 0-7. Although I can tell the configuration is set it only returns the correct value after setting it again.
I have seen several request for help with IR remotes just in the last couple of months. I hope this library will be useful for the AHK community.