• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows 10 Keyboard support
#10
OK, this is  my current AutoHotkey Script to help with Navigating (with Keyboard) in the Library screen in MobileSheets :
here's how to install/use it:
1. Install Autohotkey from https://www.autohotkey.com/
2. download the attached file MobileSheetsKeyboardShortcuts.ahk.txt 
3   Rename the downloaded file to MobileSheetsKeyboardShortcuts.ahk ( i.e. remove the .txt extension)
4. Double click on the saved MobileSheetsKeyboardShortcuts.ahk file to run it
5.Open MobileSheets and see if it works :-)

      **** IMPORTANT NOTES **** 

    1. MobileSheets MUST BE SET UP TO RUN IN FULLSCREEN MODE (in display settings), otherwise the XY co-ordinates
         of the selected menu items will change. This could cause unpredictable negative effects.
        Do not run  windowed mode: this could result in random clicks on items on your desktop / or in other apps.
    2. Because Menu item XY positions are relative to the screen size,
        the Script is set up to exit if screen resolution is not as expected.
        Extra screen resolutions could be added if you can work out mouse positions...
    3. Menu positions change in the different tabs
    4. This script has only had very limited testing on my own PC so use carefully at your own risk ;-)

 --------------------------------------------------------------------------------
   Overview of the keyboard shortcuts:
 --------------------------------------------------------------------------------
 * Function keys 1 - 7 : Selects the chosen tab, and activates the SearchBox.
 (start typing  immediately to filter results - or <backspace> remove filter).

 * Alt-L               : Selects/Activates the Searchbox
 * Alt-M               : Activates the first returned filtered result (pressing <return> takes you to pdf screen)
 * Alt-D, Alt-U        : Navigate up/down the filtered results (same as using the <up> <down> keys)


Not extensively tested, and probably not super reliable (as it's simulating mouse clicks), but it's useful enough for me...

ShaunHH

Code:
;---------------------------------------------------------------------------------
; MobileSheetsKeyboardShortcuts.ahk    
;---------------------------------------------------------------------------------
;2019-05-10

;This script allows (very) limited keyboard driven navigation in the MobileSheets Library by simulating Mouse clicks.
;**** IMPORTANT NOTES:
;     1. MobileSheets MUST BE SET UP TO RUN IN FULLSCREEN MODE (in display settings), otherwise the XY co-ordinates
;         of the selected menu items will change. This could cause unpredictable negative effects.
;  Do not run  windowed mode: this could result in random clicks on items on your desktop / or in other apps.
;     2. Because Menu item XY positions are relative to the screen size,
;        the Script is set up to exit if screen resolution is not as expected.
;     Extra screen resolutions could be added if you can work out mouse positions...
;  3. Menu positions change in the different tabs
;     4. This script has only had very limited testing on my own PC so use carefully at your own risk ;-)

                   


;  --------------------------------------------------------------------------------
;   Overview of the keyboard shortcuts:
;  --------------------------------------------------------------------------------
; * Function keys 1 - 7 : Selects the chosen tab, and activates the SearchBox.
; (start typing  immediately to filter results - or <backspace> remove filter).

; * Alt-L               : Selects/Activates the Searchbox
; * Alt-M               : Activates the first returned filtered result (pressing <return> takes you to pdf screen)
; * Alt-D, Alt-U        : Navigate up/down the filtered results (same as using the <up> <down> keys)

;---------------------------------------------------------------------------------
 

CoordMode, MouseMove, Screen

Global TabButtonsPositionY
Global SearchInputPosX
Global SearchInputPosY

;Check the screen Resolution is supported...
ScreenResolution:=A_ScreenWidth . "x" . A_ScreenHeight
if (ScreenResolution = "1920x1080")
{
;X & Y screen co-ordinates for the button pushes (for this resolution)
TabButtonsPositionY:=  24

TabButton01PositionX:= 51
TabButton02PositionX:= 160
TabButton03PositionX:= 268
TabButton04PositionX:= 368
TabButton05PositionX:= 481
TabButton06PositionX:= 582
TabButton07PositionX:= 684

SearchInputPosX:=175
SearchInputPosY:=73

FirstSearchResultPositionX:=415
FirstSearchResultPositionY:=169

}
 else ; ... unsupported screen res - otherwise we exit the script
{
Msgbox,  The MobileSheets AHK script will not work with this screen resolution - Exiting Script
ExitApp
}



#IfWinActive,MobileSheets ; We only want to send mouseClicks if MobileSheets is the active Window.

;The function keys select tabs 1 to 7 using mouse clicks, and then puts the mouse in the  SearchBox
F1::SelectTab(TabButton01PositionX)
F2::SelectTab(TabButton02PositionX)
F3:: SelectTab(TabButton03PositionX)
F4:: SelectTab(TabButton04PositionX)
F5:: SelectTab(TabButton05PositionX)
F6:: SelectTab(TabButton06PositionX)
F7:: SelectTab(TabButton07PositionX)

!L:: SelectSearchBox()

; Select the first filtered item
!M:: SelectFirstSearchResult(FirstSearchResultPositionX,FirstSearchResultPositionY)


;Map the up & down keys to alt-U and and alt-D
; - so we I can navigate the list easily without moving hands from home position
!d:: send {down}
!u:: send {up}

#IfWinActive



;--- Supporting functions

SelectTab(MousePositionX)
{
Mouseclick,left,%MousePositionX%, %TabButtonsPositionY%
SelectSearchBox()
}

SelectSearchBox()
{
 MouseMove, %SearchInputPosX%,%SearchInputPosY%,0
 click
}

SelectFirstSearchResult(PositionX,PositionY)
{

MouseMove,%PositionX%, %PositionY%
sleep 10
Mouseclick,right,%PositionX%, %PositionY%
sleep 10
Mouseclick,right,%PositionX%, %PositionY%
}
;--- End of Script -----


Attached Files
.txt   MobileSheetsKeyboardShortcuts.ahk.txt (Size: 3.96 KB / Downloads: 3)
Reply


Messages In This Thread
Windows 10 Keyboard support - by ShaunHH - 05-03-2019, 09:21 PM
RE: Windows 10 Keyboard support - by Zubersoft - 05-04-2019, 12:51 AM
RE: Windows 10 Keyboard support - by ShaunHH - 05-04-2019, 02:26 AM
RE: Windows 10 Keyboard support - by Zubersoft - 05-04-2019, 12:24 PM
RE: Windows 10 Keyboard support - by ShaunHH - 05-05-2019, 01:51 AM
RE: Windows 10 Keyboard support - by BRX - 05-05-2019, 07:34 PM
RE: Windows 10 Keyboard support - by ShaunHH - 05-09-2019, 07:37 PM
RE: Windows 10 Keyboard support - by itsme - 05-09-2019, 08:09 PM
RE: Windows 10 Keyboard support - by ShaunHH - 05-09-2019, 10:46 PM
RE: Windows 10 Keyboard support - by ShaunHH - 05-11-2019, 08:42 PM
RE: Windows 10 Keyboard support - by ShaunHH - 05-11-2019, 08:37 PM
RE: Windows 10 Keyboard support - by itsme - 05-11-2019, 08:51 PM
RE: Windows 10 Keyboard support - by ShaunHH - 05-11-2019, 09:12 PM
RE: Windows 10 Keyboard support - by itsme - 05-11-2019, 10:39 PM
RE: Windows 10 Keyboard support - by Zubersoft - 05-28-2019, 05:38 AM
RE: Windows 10 Keyboard support - by ShaunHH - 05-29-2019, 07:19 PM



Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.