Jump to content
Tarakesh

MoveMouse to the windows Tabbed Position

Recommended Posts

Tarakesh

Hi,

First of all I would like say infinite thanks to the team involved in designing this great tool.

Here is my problem

1. Press windows button

2. ESC

3. TAB

4. It will take me to the first pinned icon in the taskbar

5. If I I do SHIFT F10 which usually opens context menu like  right click of the mouse.

6. For one of the application I am using it does not support  Shift + F10 context menu rather it listens to only mouse right click event.

7. I do a search in a tree view of my application and the search item is selected or focused

8. For eg

     User1

     User2

     User3
Now if I search for User1 the tab or focus move to User 1 (Red)

     User1

     User2

     User3

If I search for User3 the tab or focus moves to User 3

Now my question is how can I move the mouse automatically go to the focused item on the window. Such that during automation I can issue MoveClick("{RIGHT}") as {SHIFT F10} is not working from the keyboard. It is a java app, unfortunately it is not honoring the right click events from keyboard to open the context

WinMinimizeAll();
Send("^{ESC}")
Sleep(200)
Send("{ESC}")
Send("{TAB}")

the above scripts take the tab to the first pinned icon in the taskbar. Now i want
MouseMove( "move to tab" selection")

Regards,
Tarakesh

Share this post


Link to post
Share on other sites
spudw2k

I can't help much with the Java app automation (no experience), but I do have a couple of comments to offer.

Instead of sending keystrokes to automate launching the pinned app, it may be more reliable and efficient to simply launch the application.
Look up the Run and ShellExecute functions.

For the right click issue, have you tried using the Menu or App key [Send({APPSKEY})] to see if it produces the proper behavior?  I know Shift+F10 usually does the same thing, but I have seen inconsistencies between some applications.  Might be worth trying, but probably no as robust as other methods to automate Java apps/controls.

Share this post


Link to post
Share on other sites
Tarakesh

I think my example is wrong.

Let me explain in another way. I have already an application open. There is a list of users displaying on the left side panel with a search box above that list.

SearchBox

User1

User2

User3

UserP

UserZ

In the search box using keyboard  tab navigation I can take the cursor into the searchbox and type User2. After search if User2 is found instead of hiding other users and displaying only this, it automatically moves tab or the focus or cursor to the User 3 and highlighted with some color.

If I Shift F10 it should shiw some extra context menu items where I can do ALT D to delete that user.

Unfortunately to simulate right click usng shift f10 is not working rather MouseClick right. But to do that mouse click i should get the position the current tab or cursuor or focus and then move the mouse to that position and do MouseRight click.

Here the position of the highlighted item after search in the list. If hightlight always goes to at particualar coordinates then no problem. But if i search for UserP or UserZ the highlight goes else where where I miss those coordinates

These Old java GWT apps some times do not support context menu using keynavigation like shift f10.

 

Share this post


Link to post
Share on other sites
gononono64

you could probably use wingetpos, wingetclientsize, PixelSearch then finally ControlClick if the highlighted user is visible

a part from that you can check the autoit window tool to see if there are any handles you can work with

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • ahha
      By ahha
      This one has me baffled.  I can't seem to get MouseMove to work properly with scaling in some windows.
      Run this program and use the arrow keys to move the mouse Up, Down, Left, Right at native (100%) scaling and it works as expected. 
      Now go to 125%, for example, and move Up, Down, Left, Right on the desktop and it works.
      Now open the MouseMove help window (cursor on MouseMove then F1).
      Move the mouse into the MouseMove help window and try Up, Down, Left, Right and the movements are diagonal!
      If you move, for example, right from desktop into the MouseMove window it goes from moving right to down and right (diagonal) as soon as the mouse hits the MouseMove help window.  I'm stumped.
      How do I get MouseMove to work properly?  Any hints appreciated.
      ; ;#AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK ;Trying to figure out how to scale properly for MouseMove - moving mouse in Up, Down, Left, Right moves diagonally on some windows if scale <> 1 (100%). ;Test on main monitor and use 1920x1080 then scale to 125% as simple example. ;To change display scale in Windows 10, right click on desktop "Display Settings" --> Scale and layout ;arrow keys on arrow keypad HotKeySet("{UP}", "__UpMouse") HotKeySet("{DOWN}", "__DownMouse") HotKeySet("{LEFT}", "__LeftMouse") HotKeySet("{RIGHT}", "__RightMouse") ;v2g - cutting out superfluous code to show issue, added scaling Opt("MouseCoordMode",1) ;1 = absolute screen coordinates (default) - use this because otherwise active window mucks it up $scale = _GetScale() MsgBox(0,"DEBUG", "$scale = " & $scale) While 1 ;watch the console - the mouse is not moving correctly Sleep(10) ;this works well and does not appear to use the CPU WEnd ;================= Functions ================== Func __UpMouse() Local $mousepos, $mouseposafter $mousepos = MouseGetPos() MouseMove($mousepos[0]+0, $mousepos[1]-1) $mouseposafter = MouseGetPos() ConsoleWrite("in __UpMouse()" & @CRLF & "Before UP (x,y) = " & $mousepos[0] & "," & $mousepos[1] & @CRLF & " After UP (x,y) = " & $mouseposafter[0] & "," & $mouseposafter[1] & @CRLF & @CRLF) EndFunc Func __DownMouse() Local $mousepos, $mouseposafter $mousepos = MouseGetPos() MouseMove($mousepos[0]+0, $mousepos[1]+1) $mouseposafter = MouseGetPos() ConsoleWrite("in __DownMouse()" & @CRLF & "Before DOWN (x,y) = " & $mousepos[0] & "," & $mousepos[1] & @CRLF & " After DOWN (x,y) = " & $mouseposafter[0] & "," & $mouseposafter[1] & @CRLF & @CRLF) EndFunc Func __LeftMouse() Local $mousepos, $mouseposafter $mousepos = MouseGetPos() MouseMove($mousepos[0]-1, $mousepos[1]+0) $mouseposafter = MouseGetPos() ConsoleWrite("in __LeftMouse()" & @CRLF & "Before LEFT (x,y) = " & $mousepos[0] & "," & $mousepos[1] & @CRLF & " After LEFT (x,y) = " & $mouseposafter[0] & "," & $mouseposafter[1] & @CRLF & @CRLF) EndFunc Func __RightMouse() Local $mousepos, $mouseposafter $mousepos = MouseGetPos() MouseMove($mousepos[0]+1, $mousepos[1]+0) $mouseposafter = MouseGetPos() ConsoleWrite("in __RightMouse()" & @CRLF & "Before RIGHT (x,y) = " & $mousepos[0] & "," & $mousepos[1] & @CRLF & " After RIGHT (x,y) = " & $mouseposafter[0] & "," & $mouseposafter[1] & @CRLF & @CRLF) EndFunc Func _GetScale() ;returns a scale factor for PixelGetColor ;from: https://www.autoitscript.com/forum/topic/156251-mouse-coordinates/?tab=comments#comment-1130002 $tDEVMODE = DllStructCreate('byte[32];dword[10];byte[32];dword[6]') $pDEVMODE = DllStructGetPtr($tDEVMODE) $i = 0 while 1 $ret = DllCall('user32.dll', 'int', 'EnumDisplaySettings', 'ptr', 0, 'dword', $i, 'ptr', $pDEVMODE) if ($ret[0] = 0) then exitloop $width = DllStructGetData($tDEVMODE, 4, 2) ; native width $i += 1 wend $scale = $width / @DesktopWidth Return($scale) EndFunc  
    • Blois
      By Blois
      Hi Guis,
       
      I need to create keyboard shortcut to navigate the tabs and activate them, but I could not use the code below:
      #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> #include <GUIConstantsEx.au3> HotKeySet("^{TAB}", "_TabRight") HotKeySet("^+{TAB}", "_TabLeft") $gui = GUICreate("test",450, 300) $Tab1 = GUICtrlCreateTab(20, 24, 425, 201) $TabSheet1 = GUICtrlCreateTabItem("Tabsheet 1") $lbContagemGrupos2 = GUICtrlCreateLabel("aaaa", 50, 50) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateTabItem("") $TabSheet2 = GUICtrlCreateTabItem(" ") $TabSheet3 = GUICtrlCreateTabItem(" ") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _TabRight() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos + 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Func _TabLeft() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos - 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Exit  
      can you help me?
    • Lecdev
      By Lecdev
      Can anyone tell me the default parameter to input into, GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "")  to disable a previously set user defined function?
      help file example says empty string ("") which works for other events but doesnt seem to on mouse move.
      Ive attached some of my test code to select icon by clicking and click on screen where needed to create an icon the same or cancel by right clicking and then escape the window with the keyboard escape key. best solution i have come up with after a few hours of trying different things is to create a DoNothing() function
       
      any help would be appreciated.
      dummy2.au3
    • FroVN
      By FroVN
      I made a software that download music and play it, but i have an idea , listen music online when we have internet connectionm ,no need for download any more, so i want to connect to soundclound but if wan to do that i need  to open google chrome , so is there any way to open that in hide and not show on taskbar? sorry for my bad english
    • WoodGrain
      By WoodGrain
      Hi All,
      I've bought a Ergodox EZ programmable keyboard with layers of key maps (eg, layer 0 = dvorak, layer 1 = numberpad & nav, layer 2 = qwerty, etc), I've also got a small USB screen that can pull information from the registry. What I would like to determine is a way to pull the value of each current key from the keyboard, I can then write the values to the registry and pull them into my USB screen so I can see the keyboard key layout.
      I'm stuck with retrieving the key values, I've looked at _IsPressed(), _WinAPI_GetKeyState(), _WinAPI_GetKeyboardState(), _WinAPI_GetKeyboardType(), _WinAPI_GetKeyNameText(), but none of them appear to be able to pull the keyboard key values without user interaction.
      The idea being, in pseudo code, bear in mind no error checking etc in this code, "GetKeyValue()" is what I'm needing help with and is a made up function, as is "HardwareKey1" etc:
      $keyOnePrev = "" $numOfKeys = 76 While 1 $keyOneCurrent = GetKeyValue(HardwareKey1) If $keyOneCurrent <> $keyOnePrev Then For $key = 1 To $numOfKeys $keyToWrite = GetKeyValue(HardwareKey & $key) RegWrite("HKEY_CURRENT_USER\Software\myKeyboard", "key" & $key, "REG_SZ", $keyToWrite) Next EndIf $keyOnePrev = $keyOneCurrent Sleep(5000) WEnd Thanks guys!
×