This script needs the AHKHID functions to be included to work correctly. This is an adaptation of a script from TheGood for using input from HID devices other than mice and keyboards. Credit and a big thank you for letting me use it goes to him.
http://www.autohotke...t=41397&start=0
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance, Force ;Must be in auto-execute section if I want to use the constants #Include C:\Program Files\AutoHotkey\lib\AHKHID.ahk ;Create GUI to receive messages Gui, +LastFound hGui := WinExist() ;Intercept WM_INPUT messages WM_INPUT := 0xFF OnMessage(WM_INPUT, "InputMsg") ;Register Remote Control with RIDEV_INPUTSINK (so that data is received even in the background) r := AHKHID_Register(13, 2, hGui, RIDEV_INPUTSINK) InputMsg(wParam, lParam) { Local devh, iKey, sLabel Critical ;Get handle of device devh := AHKHID_GetInputInfo(lParam, II_DEVHANDLE) ;Check for error If (devh <> -1) ;Check that it is my HP remote And (AHKHID_GetDevInfo(devh, DI_DEVTYPE, True) = RIM_TYPEHID) And (AHKHID_GetDevInfo(devh, DI_HID_VENDORID, True) = 23587) And (AHKHID_GetDevInfo(devh, DI_HID_PRODUCTID, True) = 0) And (AHKHID_GetDevInfo(devh, DI_HID_VERSIONNUMBER, True) = 175) { ;Get data iKey := AHKHID_GetInputData(lParam, uData) ;Check for error If (iKey <> -1) { ;Get keycode (located at the 6th byte) iKey := NumGet(uData, 1, "UChar") ;Call the appropriate sub if it exists sLabel := sPrefix "_" iKey If IsLabel(sLabel) Gosub, %sLabel% ;MsgBox, %sLabel% } } } _161: change163 = Yes SetTimer, go163, 250 Return _163: If change163 = Yes { SetTimer, go163, off change163 = off MouseClick, M ;Run, C:\Documents and Settings\Owner\My Documents\Incremental Build 1-1-2010\OSNP\OSNP.ahk GoTo go163 } Return go163: Sleep, 1000 change163 = off SetTimer, go163, off Return