AHKHID
AHKHID copied to clipboard
Error: Call to nonexistent function.
When i execute example_1.ahk i always just get
---------------------------
example_1.ahk
---------------------------
Error: Call to nonexistent function.
Specifically: AHKHID_UseConstants()
Line#
020: Gui,Add,ListView,x16 y40 w440 h150 vlvwKeyb gLV_Event AltSubmit,Name|Type|SubType|Keyboard Mode|Number of Function Keys|Number of Indicators|Number of Keys Total
021: Gui,Tab,2
022: Gui,Add,ListView,x16 y40 w440 h150 vlvwMouse gLV_Event AltSubmit,Name|Mouse ID|Number of Buttons|Sample Rate
023: if bVista
024: LV_InsertCol(5, "", "Has Horizontal Wheel")
025: Gui,Tab,3
026: Gui,Add,ListView,x16 y40 w440 h150 vlvwOther gLV_Event,Name|Vendor ID|Product ID|Version Number|Usage Page|Usage
---> 029: AHKHID_UseConstants()
032: iCount := AHKHID_GetDevCount()
035: Loop,%iCount%
035: {
037: HID0 += 1
040: HID%HID0%_Handle := AHKHID_GetDevHandle(HID0)
041: HID%HID0%_Type := AHKHID_GetDevType(HID0)
042: HID%HID0%_Name := AHKHID_GetDevName(HID0)
The program will exit.
---------------------------
OK
---------------------------
You need to include the library in your code.
Download AHKHID.ahk to the same directory as example_1.ahk: https://github.com/jleb/AHKHID/raw/master/AHKHID.ahk Add `#include AHKHID.ahk' to the top of the example.
This begs the question "Why don`t the examples already contain this line in them?" You never want examples to require setup.
Ran into same problem, suggested fix worked.
This is really dumb :)