Trouble with GetInput.exe and hovering.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Cornbeetle
Posts: 31
Joined: 23 Nov 2015 09:34

Trouble with GetInput.exe and hovering.

#1 Post by Cornbeetle » 03 Feb 2017 12:36

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

Aacini
Expert
Posts: 1885
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Trouble with GetInput.exe and hovering.

#2 Post by Aacini » 03 Feb 2017 13:12

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

Cornbeetle
Posts: 31
Joined: 23 Nov 2015 09:34

Re: Trouble with GetInput.exe and hovering.

#3 Post by Cornbeetle » 03 Feb 2017 16:40

@Aacini

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

Post Reply