diff --git a/README.md b/README.md index 2be163e..f5ae337 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,26 @@ AHKHID - An AHK implementation of the HID functions [AHKHID](AHKHID.ahk) allows you to easily interface with HID devices (such as keyboards, mice, joysticks, etc...) in your AHK code without having to resort to -interacting with the raw input API of Windows. The AutoHotkey forum thread is +interacting with the raw input API of Windows. The original AutoHotkey forum thread can be found [here](http://www.autohotkey.com/board/topic/38015-ahkhid-an-ahk-implementation- of-the-hid-functions/). All the API calls that AHKHID wraps can be found here: http://msdn.microsoft.com/en-us/library/ms645543.aspx -AHKHID includes three examples: +To get started download the entire repo and chech out the three included AHKHID examples. +They should work as is from the examples folder with AHKHID.ahk at the root +(or you can edit the #include's to specify a unique path) + * [Example 1](examples/example_1.ahk) lists all the HID devices currently connected to your computer -* [Example 2](examples/example_2.ahk) allows you to register for input from any +* [Example 2](examples/example_2.ahk) allows you to register input from any HID device and display the incoming data * [Example 3](examples/example_3.ahk) shows how the mouse can be registered -[Documentation](documentation.md) + +To use AHKHID in your own scripts simply include AHKHID.ahk in the same folder and +add '#include AHKHID.ahk' to the begining of your script. Then add a HID_Register() call +and use OnMessage() to react to the desired calls found from example 2 or prior knowledge. + +For more detail information check out the [Documentation](documentation.md). diff --git a/examples/example_1.ahk b/examples/example_1.ahk index 2ab0e9c..aa1c08a 100644 --- a/examples/example_1.ahk +++ b/examples/example_1.ahk @@ -9,6 +9,7 @@ 1. Simply run the script. 2. Press Ctrl+c on a selected item to copy its name. */ +#include ../AHKHID.ahk ;Check if the OS is Windows Vista or higher bVista := (DllCall("GetVersion") & 0xFF >= 6) diff --git a/examples/example_2.ahk b/examples/example_2.ahk index 2900ae4..02762e6 100644 --- a/examples/example_2.ahk +++ b/examples/example_2.ahk @@ -17,6 +17,7 @@ For example, if you'd like to register the keyboard and the mouse, put UsagePage 1 and check the flag RIDEV_PAGEONLY. Then press Add and then Call to register. */ +#include ../AHKHID.ahk ;Check if the OS is Windows Vista or higher bVista := (DllCall("GetVersion") & 0xFF >= 6) diff --git a/examples/example_3.ahk b/examples/example_3.ahk index 3437343..094064b 100644 --- a/examples/example_3.ahk +++ b/examples/example_3.ahk @@ -12,6 +12,7 @@ 4. Doubleclick any of the listboxes to clear. 5. Press Unregister (or Alt+u) to stop monitoring the mouse. */ +#include ../AHKHID.ahk ;To make x,y movements look nice SetFormat, FloatFast, 3.0