Sending CGI commands with keypress

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Voffel
Posts: 1
Joined: 25 Apr 2018, 12:04

Sending CGI commands with keypress

25 Apr 2018, 12:15

Hi everyone. :wave:

I am new to both AutoHotKey and scripting, so I am looking for some assistance.
What I am trying to do here is send some xmlhttprequests to a camera with just a press on they keyboard.
I am not that good at scripting so I figured it was easier to ask first before i go to far down on a wrong path.

What I am trying to do is have a keypress send a cgi command to a camera. Something like this:
----------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

j::
whr.Open("GET", "http://IP-ADDRESS/axis-cgi/opticssetup. ... stamp=1408", true)
whr.Send()
Return

k::
whr.Open("GET", "http://IP-ADDRESS/axis-cgi/opticssetup. ... stamp=1408", true)
whr.Send()
Return
----------------------------------------------------------------

Could anyone give me some pointers in what direction i have to go. basicly i want it to be so that whenever a specific key is pressed, the XMLHttpRequest is sent.
I want this running in the background and at startup.
I have this working in a html page like this:

var xhttp = new XMLHttpRequest();
xhttp.open("GET", "http://" + ipAddress + "/axis-cgi/opticssetup.cgi?rfocus=-0.05&timestamp=1408,true"
xhttp.send();

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750 and 245 guests