Jump to content

Recommended Posts

Posted

Hi Guys

I'm new to this forum and I need your expertise,

I'm looking for a script that allows me to click on button in XY coordination when a mouse got clicked in another XY coordination. Basically, I have a hidden keyboard that I would like show to a user when a search button get clicked and then hid it when the go button get clicked.

Thanks in advance

Posted

You do not need XY to click a button, your need is hard to understand.

Please explain a little further, perhaps an example code.

I have an interactive application in kiosk mode that our customers uses to search for article number using a keyboard (hardware) even though we have a touch screen. My idea is to get rid of that keyboard(hardware) and launch a onscreen keyboard at startup. I don't have the original code for that application to integrate the onscreen keyboard. This onscreen keyboard have a key that allows me to hide and show the keyboard.

So, I want the mouse to click on the showKeyboard button when a customer press the search button on my application and than another mouse click to hide the keyboard when the same customer press OK button.

Unfortunatly I don't have an example code and I searched everywhere.

The attached is a print screen of my keyboard

post-64738-0-55207500-1305036025_thumb.j

Posted

So this "interactive application", is it a web application? I ask because you mention "kiosk mode".

It's not a web base application.

Its a VBNET package and its sitting on c drive.

Posted

I know how to use a mouseclick function I just don't know how to tell the script to wait for an action from a user. I keep getting error when I tried the IF statement.

Posted

How are you setting up your "If" statement?

While 1

If _IsPressed(01) Then

RunFunction()

EndIf

Wend

Ĥere is an example code I tried

AutoItSetOption("MouseCoordMode", 2)

AutoItSetOption("TrayIconDebug", 1)

Func MouseBezier($x,$y)

while 1

$pos = MouseGetPos()

if $pos[$x]= 1010 and $pos[$y]= 1141 Then

MouseClick("left",1015,1241,1,1)

EndIf

WEnd

EndFunc

Posted (edited)

It's not going to be $pos[$x] and $pos[$y] it will be $pos[0] and $pos[1] as mousegetpos returns [0] = x and [1] = y

In the code below I defined the XY coordination and it works like a charm. What's the best way to set a range of XY to cover the whole button area.

AutoItSetOption("MouseCoordMode", 2)

AutoItSetOption("TrayIconDebug", 1)

while 1

$pos = MouseGetPos()

ToolTip($pos)

if $pos[0]= 160 and $pos[1]= 44 Then

MouseClick("left",1015,1241,1,1)

EndIf

WEnd

Edited by yous

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...