(2018-05-05, 16:02)ilGimmy Wrote: (2018-04-28, 03:48)RobbieWilkes Wrote: Since the web version is the most feature-filled and well-supported version, I decided to just build an AutoHotkey script that would allow me to launch Netlix via Chrome in a full-screen (kiosk) mode, and then control it with my MCE remote, with a lot of the same functionality that I have in Kodi. It's working pretty well, and, since I wrote it, I can update it as I desire, or whenever Netflix makes a change.
Can you share at least an hint of how have you approached the problem of selecting items via left/right instead of mouse?
Do you move the mouse of specific pixels when left/right are pressed? how about navigating outside to elements outside the window?
Thanks!
Yes, for the arrow movements, I'm just moving the mouse a certain number of pixels in the associated direction.
As for scrolling, nothing too fancy was needed in Netflix, because the Right & Left scroll arrows are always available in the same location for each row. So, I'm simply monitoring the mouse x coordinate, and, as it reaches a designated value, I just jump to a designated spot and click. I'll provide some of the code below. If you'd like, I'll be happy to share it all, though it's not cleaned up or annotated as well as I'd like.
As you'll see, I've hardcoded the values into the sequences, which is what I meant with it being specific to my setup. I have updated my YouTubeTV script to use variables, based on the resolution, and, because it's NOT consistent like Netflix, I utilize an ImageSearch to find the scroll arrows. When I have time to kill, I'm going to go back and update my Netflix script with variables, consolidated routines, and do away with all the "else"s, but, for now, it's working perfectly.
BTW... the "GetActiveBrowserURL" function is a LIFESAVER, as it allows one to determine if a video is being played (contains WATCH), and to use the arrows for play control, rather than mouse movement. Also, you'll see that I'm utilizing "TiVo Sounds", which goes along with the consistent experience that I'm trying to provide when launching from Kodi... and I just find the sounds so darn soothing. :-)
Feel free to ask if you have any questions. I'm happy to share, as I've learned so much from those that are also willing to do the same.
Right::
{
sURL := GetActiveBrowserURL()
WinGetClass, sClass, A
if sURL contains watch
{
MouseMove 960, 350
send +{Right}
send {Enter}
SP(SoundMode,TiVoBloop)
Return
}
MouseGetPos, xpos, ypos
; Tooltip %xpos%, %ypos%
; SetTimer, RemoveToolTip, 3000
if xpos >= 1650
{
MouseMove 1860, %ypos%
MouseClick, left, 1860, %ypos%
SP(SoundMode,TiVoBloop)
Return
}
else
{
MouseMove 200, 0, 1, R
SP(SoundMode,TiVoBloop)
Return
}
}
Left::
{
sURL := GetActiveBrowserURL()
WinGetClass, sClass, A
if sURL contains watch
{
MouseMove 960, 350
send +{Left}
send {Enter}
SP(SoundMode,TiVoBloop)
Return
}
MouseGetPos, xpos, ypos
if (xpos <= 250)
{
MouseMove 10, %ypos%
Sleep 350
MouseClick, left, 30, %ypos%
SP(SoundMode,TiVoBloop)
return
}
else
{
MouseMove -200, 0, 1, R
SP(SoundMode,TiVoBloop)
Return
}
}
Up::
{
sURL := GetActiveBrowserURL()
WinGetClass, sClass, A
if sURL contains watch
{
MouseMove 960, 350
Send {Up}
SP(SoundMode,TiVoDing)
Return
}
MouseGetPos, xpos, ypos
if (ypos <= 200)
{
Send {WheelUp}
SP(SoundMode,TiVoBloop)
Return
}
else
{
MouseMove 0, -100, 1, R
SP(SoundMode,TiVoBloop)
Return
}
}
Down::
{
sURL := GetActiveBrowserURL()
WinGetClass, sClass, A
if sURL contains watch
{
MouseMove 960, 350
send {Down}
SP(SoundMode,TiVoDing)
Return
}
MouseGetPos, xpos, ypos
if (ypos >= 880)
{
Send {WheelDown}
SP(SoundMode,TiVoBloop)
Return
}
else
{
MouseMove 0, 100, 1, R
SP(SoundMode,TiVoBloop)
Return
}
}
Enter::
Space::
media_play_pause::
{
sURL := GetActiveBrowserURL()
WinGetClass, sClass, A
if sURL contains watch
{
MouseMove 960, 350
Send {Enter}
SP(SoundMode,TiVoSelect)
Return
}
else
{
Send {Click}
SP(SoundMode,TiVoSelect)
Return
}
}
;Stop Button - Pause & Browser_Back
media_stop::
{
Click, 960, 120
Send {Browser_Back}
Return
SP(SoundMode,TiVoBack)
}
;BackSpace - Previous Page
Backspace::
{
Send {Browser_Back}
SP(SoundMode,TiVoBack)
Return
}