Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
amichalec Absent Member.
Absent Member.
3846 views

mouse click

Jump to solution

Is there a way to simulate a mouse left button click in a program. So that I can act as if the mouse left button was clicked however no interaction from the user?

0 Likes
1 Solution

Accepted Solutions
neidingd Honored Contributor.
Honored Contributor.

RE: mouse click

Jump to solution

Hello,

tested alot with vbscript and so on... but no result.

The only way to get it working was to build a "Click Left Mouse EXE" with AutoIT.

www.autoitscript.com/.../downloads

The OutoIT Script is very simple:

---------------

#include <AutoItConstants.au3>

; click at the current mouse position.

MouseClick($MOUSE_CLICK_LEFT)

---------------

compiled it to an exe...

then call it in cobol:

          call "c$system" using "c:\muffrohr\LMouse.exe", 97 end-call.

I only tested the sorting... by placing the mouse manual to the header of the cell in a grid and then press <F1> to call the exe. After i pressed <F1> the sorting in the grid happens.

View solution in original post

0 Likes
11 Replies
neidingd Honored Contributor.
Honored Contributor.

RE: mouse click

Jump to solution

the only idea i have is to use the Mouse Exception (In Manual 7.3.1 Descriped) and then use W$KEYBUF to simulate the input.

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: mouse click

Jump to solution

Can you describe what you are trying to achieve? Are you trying to place focus on a certain area, or a tool tip?

0 Likes
JimRead Absent Member.
Absent Member.

RE: mouse click

Jump to solution

If there is some bit of logic you intend to execute that executes in response to a mouse-click, why not simply call that logic?

0 Likes
amichalec Absent Member.
Absent Member.

RE: mouse click

Jump to solution

Trying to force a grid sort on a particular column. After loading the grid I am placing the mouse pointer on the column header. I then want to force a mouse click for the grid to sort on that particular column.

We keep track of a user's preference for which column they want sorted for our lookup lists. Then when list is loaded I want to sort by the column they prefer

0 Likes
dalekreitzer
Visitor.

RE: mouse click

Jump to solution

You're going about it the wrong way.  Instead of loading the grid, then calling the sort, sort the data before you load it into the grid.

Dale

0 Likes
amichalec Absent Member.
Absent Member.

RE: mouse click

Jump to solution

problem is the column is not a key so I can't load the grid  sorted

0 Likes
neidingd Honored Contributor.
Honored Contributor.

RE: mouse click

Jump to solution

Hello,

tested alot with vbscript and so on... but no result.

The only way to get it working was to build a "Click Left Mouse EXE" with AutoIT.

www.autoitscript.com/.../downloads

The OutoIT Script is very simple:

---------------

#include <AutoItConstants.au3>

; click at the current mouse position.

MouseClick($MOUSE_CLICK_LEFT)

---------------

compiled it to an exe...

then call it in cobol:

          call "c$system" using "c:\muffrohr\LMouse.exe", 97 end-call.

I only tested the sorting... by placing the mouse manual to the header of the cell in a grid and then press <F1> to call the exe. After i pressed <F1> the sorting in the grid happens.

View solution in original post

0 Likes
amichalec Absent Member.
Absent Member.

RE: mouse click

Jump to solution

Thanks I'll look into that

0 Likes
amichalec Absent Member.
Absent Member.

RE: mouse click

Jump to solution

Thanks all for your help

0 Likes
rstoll Absent Member.
Absent Member.

RE: mouse click

Jump to solution

Don't know how many rows are in the grid, but could you sort it 3 different ways into 3 different arrays and depending on which column they click, display the appropriate sorted array?  

0 Likes
neidingd Honored Contributor.
Honored Contributor.

RE: mouse click

Jump to solution

you can inquire the max rows...

inquire sample-grid, last-row = max-rows.

give only a little problem, when in the first row sometimes no value is... you get the wrong last-row value back.

Sort in Grid is Possible since Version 9.2.

You have to define which columns are sortable, and when the header of the column is clicked the grid get sorted.

Look in the manual for "sort-types"

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.