Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates? Topic is solved

Talk about anything
GavinPen
Posts: 25
Joined: 24 Oct 2017, 16:49
GitHub: GavinPen

Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

24 Oct 2017, 17:15

Some vim-like Chrome extensions allocate and display key shortcuts which allow you to navigate to all links, text inputs and buttons on a page, eg
http://www.damianbast.com/content/image ... vimium.jpg

Dragon NaturallySpeaking's mousegrid
http://www.nuance.com/products/help/dra ... eGrid.html
allows you to zoom in on a particular spot on your screen using successive 3*3 grids.

Does anybody know if a tool in a similar vein (ahk-derived or otherwise) exists to display a grid over your whole screen,
and allocate alphanumeric coordinates (say rows A-Z,0-9, columns A-Z,0-9) to each cell, allowing you to click anywhere in the screen via the appropriate cell's unique 2 key combination (eg A2, 6Z, etc)?
User avatar
nnnik
Posts: 4497
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

25 Oct 2017, 01:24

I dont know if something like this exists but this shouldn't be difficult to make in AHK
Recommends AHK Studio
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

25 Oct 2017, 01:57

I use this, which treats the screen as nine rectangles, and moves the cursor to the centre of a rectangle based on pressing Win+NumpadXXX. (I then use a keyboard via mouse script to navigate to the precise point, using Win+Left/Up/Right/Down.)

Code: Select all

#NumpadEnd:: ;mouse via keyboard - jump to region of screen
#NumpadDown::
#NumpadPgDn::
#NumpadLeft::
#NumpadClear::
#NumpadRight::
#NumpadHome::
#NumpadUp::
#NumpadPgUp::
#Numpad1::
#Numpad2::
#Numpad3::
#Numpad4::
#Numpad5::
#Numpad6::
#Numpad7::
#Numpad8::
#Numpad9::

vHotkey := StrReplace(A_ThisHotkey, "#Numpad")
vListKey := "End,Down,PgDn,Left,Clear,Right,Home,Up,PgUp"
oListX := StrSplit("1,2,3,1,2,3,1,2,3", ",")
oListY := StrSplit("3,3,3,2,2,2,1,1,1", ",")

;middle of top-left ninth of screen is 1/6 along, 1/6 down
;middle of middle ninth of screen is 3/6 along, 3/6 down
;middle of bottom-right ninth of screen is 5/6 along, 5/6 down

Loop, Parse, vListKey, `,
{
	if (vHotkey = A_LoopField) || (vHotkey = A_Index)
	{
		vPosX := Round((((oListX[A_Index] * 2) - 1) / 6) * A_ScreenWidth)
		vPosY := Round((((oListY[A_Index] * 2) - 1) / 6) * A_ScreenHeight)
		break
	}
}

vCMM := A_CoordModeMouse
vDMS := A_DefaultMouseSpeed
CoordMode, Mouse, Screen
SetDefaultMouseSpeed, 0
MouseMove, % vPosX, % vPosY
CoordMode, Mouse, % vCMM
SetDefaultMouseSpeed, % vDMS
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
GavinPen
Posts: 25
Joined: 24 Oct 2017, 16:49
GitHub: GavinPen

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

25 Oct 2017, 03:45

Thanks jeeswg, that script looks useful in its own right, and also as an example of how to move to coordinates.
What I still don't know how to do, however, is display the shortcut key combination for each coordinate
guest3456
Posts: 3328
Joined: 09 Oct 2013, 10:31

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

26 Jun 2018, 23:21

I could've sworn something like this was built into Windows, but i'm not finding it in the Control Panel. I know I used something like this before

edit: ohhh it was Windows Speech Recognition. see this video:


User avatar
tidbit
Posts: 1268
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

27 Jun 2018, 20:42

my unreleased ahk screen grid, Not sure if I want to release it or not :/
https://streamable.com/gn39d

Image
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
GavinPen
Posts: 25
Joined: 24 Oct 2017, 16:49
GitHub: GavinPen

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

28 Jun 2018, 09:05

Thanks all

@guest3456 - that looks similar to the Dragon NaturallySpeaking MouseGrid
@Guest - I somehow couldn't get Mouse Numpad Grid to work

@tidbit - This looks very useful. Again looks similar to the Speech Recognition ones, but more convenient to control it from the keyboard instead of by speech.
Are you using NumPad 1-9 to choose the cells?
User avatar
tidbit
Posts: 1268
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

28 Jun 2018, 10:47

yup
numpad controls.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
dsewq1LYJ
Posts: 116
Joined: 26 Aug 2014, 23:21

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

05 Nov 2021, 06:39

tidbit wrote:
27 Jun 2018, 20:42
my unreleased ahk screen grid, Not sure if I want to release it or not :/
https://streamable.com/gn39d

Image
it looks insanely useful, do you mind share some tip how to achive this?
User avatar
tidbit
Posts: 1268
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

05 Nov 2021, 11:51

  • a_screenwidth/height
  • basic math (divide the above by 3)
  • store the 9 parts in an array (my array is multi-dimensional, not a flat array)
  • when you choose a cell, get the x/y/w/h of it (this is easy. w/h will always be the same. only x/y change. and its stored in the array. simple read of a value)
  • divide by 2 to get the center of that cell
  • repeat all that for the newly selected cell
if you want to use the numpad like I did, simply give each key a value. numpad1 = 1, etc. then do myArr[numKeyPressed] or w/e
As for drawing lines, that uses gdip. I recommend robod's extended version https://github.com/marius-sucan/AHK-GDIp-Library-Compilation
dsewq1LYJ wrote:
05 Nov 2021, 06:39
it looks insanely useful, do you mind share some tip how to achive this?
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
franklin_pierce
Posts: 2
Joined: 04 Jan 2022, 11:07

Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates?

04 Jan 2022, 11:21

Hello to anyone else who stumbles on this thread.

I too wanted to find a MouseGrid tool, and after a bit of searching around I found one that works.
I've modified a script from this archived thread here
https://www.autohotkey.com/board/topic/48680-mouse-numpad-grid/
It seems to work identically to the one that Tidbit shows above.

I only modified @DarkVamprism script to the point that you can immediate move the mouse to click, or just move, inside the center of the current Grid. Set to NumPad 0
I also tweaked it that the last grid, the 6th, moves and clicks the mouse to the center, instead of the top left of the final square. You can compare the two to see the difference. Otherwise I found his script to be great!

Note, it requires Gdip.ahk for drawing the GUI.
The current 64bit version can be found here:
https://www.autohotkey.com/boards/viewtopic.php?t=6517

Current Code:

Code: Select all

; Author DevX
; Mastering by DarkVamprism
;Tiniest tweak by Franklin_Pierce
 
#NoEnv
#SingleInstance, force
CoordMode, Mouse
SetBatchLines -1
SetMouseDelay -1

#Include, Gdip.ahk 

; Start gdi+ 
If !pToken := Gdip_Startup() 
{ 
   MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 
   ExitApp
} 
OnExit, Exit 
return

NumpadEnter::
   KeyMouseToggle := !KeyMouseToggle
   if KeyMouseToggle
   {
      Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs 
      Gui, 1: Show, NA 
      hwnd1 := WinExist() 
      hbm := CreateDIBSection(A_ScreenWidth, A_ScreenHeight) 
      hdc := CreateCompatibleDC()
      obm := SelectObject(hdc, hbm)
      G := Gdip_GraphicsFromHDC(hdc)
      Gdip_SetSmoothingMode(G, 4)
      pBrush := Gdip_BrushCreateSolid(0xffff0000) 
      pPen := Gdip_CreatePen(0xff00ff00, 1) 
      Gdip_DrawLine(G, pPen,  Floor(A_ScreenWidth/3), 0,  Floor(A_ScreenWidth/3), A_ScreenHeight) 
      Gdip_DrawLine(G, pPen, Floor(A_ScreenWidth/3*2), 0, Floor(A_ScreenWidth/3*2), A_ScreenHeight) 
      Gdip_DrawLine(G, pPen, 0,  Floor(A_ScreenHeight/3), A_ScreenWidth,  Floor(A_ScreenHeight/3)) 
      Gdip_DrawLine(G, pPen, 0,  Floor(A_ScreenHeight/3*2), A_ScreenWidth,  Floor(A_ScreenHeight/3*2))
      UpdateLayeredWindow(hwnd1, hdc, 0, 0, A_ScreenWidth, A_ScreenHeight) 
      SelectObject(hdc, obm) 
      DeleteObject(hbm) 
      DeleteDC(hdc) 
      Gdip_DeleteGraphics(G)
      
      init()
   }
   else
   {
     Gui, 1: Destroy
   }
return

#if KeyMouseToggle
   NumPad1::SelectWindow(1) 
   NumPad2::SelectWindow(2) 
   NumPad3::SelectWindow(3) 
   NumPad4::SelectWindow(4) 
   NumPad5::SelectWindow(5) 
   NumPad6::SelectWindow(6) 
   NumPad7::SelectWindow(7) 
   NumPad8::SelectWindow(8) 
   NumPad9::SelectWindow(9)
   NumPad0::ClickTheButtonNow()

#if

Init()
{
   global
   currX := 0
   currY := 0
   currW := A_ScreenWidth
   currH := A_ScreenHeight
}

SelectWindow(Win)
{
   global
   currW := currW / 3
   currH := currH / 3
      
   if (Win >= 1 and Win <= 3) 
   { 
      currY := currY + (currH * 2)
   }
   else if (Win >= 4 and Win <= 6) 
   { 
      currY := currY + currH
   }
   else if (Win >= 7 and Win <= 9) 
   { 
      currY := currY
   }
   
   if (Win == 1 || Win == 4 || Win == 7) 
   { 
      currX := currX
   }
   else if (Win == 2 or Win == 5 or Win == 8)
   { 
      currX := currX + currW
   }
   else if (Win == 3 or Win == 6 or Win == 9)
   { 
      currX := currX + (currW * 2) 
   }
   
   if (CurStep == 5) 
   { 
      CurStep := 0
      KeyMouseToggle := false
      Gui, 1: Destroy 
      ClickTheButton()
      return 
   } 
   
   CurStep++
   DrawNewBox()
}

DrawNewBox() 
{ 
  global 
  Gui, 1: Destroy 
  Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs 
  Gui, 1: Show, NA 
  hwnd1 := WinExist() 
  hbm := CreateDIBSection(A_ScreenWidth, A_ScreenHeight) 
  hdc := CreateCompatibleDC() 
  obm := SelectObject(hdc, hbm) 
  G := Gdip_GraphicsFromHDC(hdc) 
  Gdip_SetSmoothingMode(G, 4) 

   if (currY > 0) 
      Gdip_DrawLine(G, pPen, currX, currY, currX + currW, currY) 
   if (currX > 0) 
      Gdip_DrawLine(G, pPen, currX, currY, currX, currY + currH) 
   if ( (currY + currH) <= A_ScreenHeight ) 
      Gdip_DrawLine(G, pPen, currX, currY + currH, currX + currW, currY + currH) 
   if ( (currX + currW) <= A_ScreenWidth )
      Gdip_DrawLine(G, pPen, currX + currW, currY, currX + currW, currY + currH) 

  Gdip_DrawLine(G, pPen, currX, currY + ( currH / 3 ), currX + currW, currY + ( currH / 3 ) ) 
  Gdip_DrawLine(G, pPen, currX, currY + ( ( currH / 3 ) * 2 ), currX + currW, currY + ( ( currH / 3 ) * 2) ) 

  Gdip_DrawLine(G, pPen, currX + ( currW / 3 ), currY, currX + ( currW / 3 ), currY + currH ) 
  Gdip_DrawLine(G, pPen, currX + ( ( currW / 3 ) * 2 ), currY, currX + ( ( currW / 3 ) * 2 ),  currY + currH ) 
  

  UpdateLayeredWindow(hwnd1, hdc, 0, 0, A_ScreenWidth, A_ScreenHeight) 
  
  SelectObject(hdc, obm) 
  DeleteObject(hbm) 
  DeleteDC(hdc) 
  Gdip_DeleteGraphics(G) 
  Gui, 1: Show, NA 
}

ClickTheButton() 
{ 
  global
  MouseClick, Left, (currx+currW/2), (curry+currH/2), 1, 0 
}

ClickTheButtonNow() 
{ 
  global
  MouseClick, Left, (currx+currW/2), (curry+currH/2), 1, 0 
  CurStep := 0
      KeyMouseToggle := false
      Gui, 1: Destroy 
  ;sgBox, %currw%  %currh% %curry%5 %curry%
}


Exit: 
   Gdip_Shutdown(pToken) 
ExitApp

Return to “Offtopic”

Who is online

Users browsing this forum: No registered users and 5 guests