An official Batch Programming blog! To Solve the daily problems with windows and fixing them with little notepad scripts. Unlock the Hidden Secrets of Windows, Learn to crack Software via CMD & Make your own Programming tools. Understand to Manipulate your PC via CMD.

TheBATeam Forum

how can use getinpu...
 
Notifications
Clear all

how can use getinput.exe  


mr1ay
Posts: 15
(@mr1ay)
Active Member
Joined: 6 months ago

ı dont understand

8 Replies
sintrode
Posts: 13
(@sintrode)
Active Member
Joined: 3 months ago

At the very basic level, you just run GetInput.exe and then a representation of what the user entered is stored in the %errorlevel% variable. If the user pressed a key, %errorlevel% will be positive. If the user clicked the mouse, %errorlevel% will be negative.

If all you need to check is if the user clicked something, just use 

GetInput
if %errorlevel% leq 0 (
    echo Mouse was clicked
)

If you need to check where the user clicked something, use the code in Usage.txt, remembering that the top-left corner of the screen is 0,0.

GetInput
if %errorlevel% gtr 0 (
echo Key pressed: %errorlevel%
) else (
rem Mouse button clicked
set /A "input=-%errorlevel%, row=input >> 16, col=input & 0xFFFF"
if !col! lss 32768 (
echo LEFT button clicked at !row!,!col!
) else (
set /A col-=32768
echo RIGHT button clicked at !row!,!col!
)
)

 

Reply
Kvc
Posts: 27
 Kvc
Admin
(@thekvc)
Admin
Joined: 2 years ago

@mr1ay Have you tried the Example file provided with the Getinput.exe plugin's distribution pack? it might help you to clarify its purpose. And, you will also find the Usage.txt file that might be useful too.

@Sintrode has explained it very well too. Please let me know if you still are not clear.

 

Reply
mr1ay
Posts: 15
(@mr1ay)
Active Member
Joined: 6 months ago

@thekvc ı dont understood.

I find usage.txt  insufficient.

give more examples and please explain more

input.exe is using a lot of memory. so I want to use getinput.exe

Reply
5 Replies
sintrode
(@sintrode)
Joined: 3 months ago

Active Member
Posts: 13

@mr1ay - What other things are you trying to do with GetInput that I didn't cover in my first post?

Reply
mr1ay
(@mr1ay)
Joined: 6 months ago

Active Member
Posts: 15

@sintrode   I'm designing my own mouse menu

Reply
sintrode
(@sintrode)
Joined: 3 months ago

Active Member
Posts: 13

@mr1ay - And what part of determining if and where a button was clicked doesn't fit your needs?

Reply
mr1ay
(@mr1ay)
Joined: 6 months ago

Active Member
Posts: 15

@sintrode   I did not understand what coordinate to do with mouseover with getinput.exe

Reply
Kvc
 Kvc
Admin
(@thekvc)
Joined: 2 years ago

Admin
Posts: 27

@mr1ay This is the problem you are facing??? - https://ibb.co/Z2TtDDB

Although...

set /A "input=-%errorlevel%, row=input >> 16, col=input & 0xFFFF"

This Line of Code from @sintrode code is calculating and saving the co-ordinates in the variables... %row% & %col%.

The Demo of the Code is working perfectly fine, and no Right Click context menu is popping up - https://ibb.co/gvzs63h

Please also check the attached test file... that might help you! (Watch This video)

Reply
Share:

© 2020 TheBATeam

Our Core Values   /   Terms & Conditions   /   Privacy Policy   /   Why Register?

Theme by Anders Norén