Page 1 of 1

Trouble with GetInput.exe and hovering.

Posted: 03 Feb 2017 12:36
by Cornbeetle
Why are the two options "print" and "Scan" not affected correctly? I've set the coordinate range to cover each word for the hovering according to the errorlevel it gives when I click on "print" and "scan"...

Code: Select all

color 07 & cls
echo Choose an option:
echo Print
echo Scan
GetInput /M -65536 0 -65540 0 -131072 0 -131078 0 /H
if %errorlevel%==-65537 echo Print selected
if %errorlevel%==-131072 echo Scan selected
pause

Re: Trouble with GetInput.exe and hovering.

Posted: 03 Feb 2017 13:12
by Aacini
GetInput.txt help file wrote:GetInput [/T msecs] [/I] [{"chars"|keycode}...]
[ /M left top right bottom ... [/H [h1 h2 h3 ...]] ]

/M l t r b ... Coordinates of input selection boxes for mouse clicks.

...

If a list of coordinates for selection boxes is given, the *position* of the
selected box in the list is returned starting at one; ...

...

When no /M switch (list of selection boxes) is given, mouse button click
positions are returned as negative errorlevel values.

...

Screen coordinates start in 0 0 at the left-top corner of the screen.


That is:

Code: Select all

@echo off

color 07 & cls
echo Choose an option:
echo Print
echo Scan
rem          Print                    "Print" is in line 1, in columns 0 to 4
rem                   Scan            "Scan" is in line 2, in columns 0 to 3
GetInput /M  0 1 4 1  0 2 3 2 /H
if %errorlevel%==1 echo Print selected
if %errorlevel%==2 echo Scan selected
pause

Antonio

Re: Trouble with GetInput.exe and hovering.

Posted: 03 Feb 2017 16:40
by Cornbeetle
@Aacini

Thank you, I'm studying more of the documentation to get a better understanding.