Win Opening Kodi with harmony remote but its not the active window
#1
I use a script (below)  for the "green button" on my remote to open kodi. but after updating to 17.6 it will open it but doesnt seem to make it the active window so i cant control kodi. when i had this issue (rarely) with v16 i used to press the button again and it would make it active and all worked. but now it wont even make it active again so i have to go to the keyboard and click on the kodi windo to be able to use my remote.

how does everybody else deal with opening kodi and not have this issue?
Quote:;Written by EliteGamer360, Please give credit When you Copy and use my scripts for any other purpose.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#SingleInstance, Force
^!Enter::    ;Ctrl-Alt-Enter is the shortcut for greenbutton_Win64bit
    IfWinNotExist kodi.exe ;If kodi is not running
    VarSetCapacity(si,44)
    DllCall("GetNativeSystemInfo", "uint", &si)
        if ErrorLevel {
        MsgBox Windows XP or later required.
        ExitApp
    }
        ARM := NumGet(si,0,"ushort")
        run % ARM=0 ? "C:\Program Files\kodi\kodi.exe" : ARM=9 ? "C:\Program Files (x86)\kodi\kodi.exe" : ARM=6 ? "IA64" : "Unknown System"

        f (ARM = 0)
        {
            32or64 := "32bit"
        }
        If (ARM = 9)
        {
            32or64 := "64bit"
        }
        If (ARM = 6)
        {
            32or64 := "Unknown System"
    }

    WinActivate ;Activate and Refocus kodi.
    WinShow ;Bring kodi to front.
    WinGet, Style, Style, ahk_class kodi
    if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
    {
        Send {VKDC}  ;Maximize kodi to fullscreen mode if its in a window mode.
    }
    Return


        SetTitleMatchMode 2
        #IfWinActive kodi ahk_class kodi ; kodi detection for kodi/GSB Home Screen action.
        ^!Enter::
        WinGet, Style, Style, ahk_class kodi
        if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
        {
                Send {VKDC}  ;Maximize kodi to fullscreen mode if its in a window mode.
        }
        ;WinMaximize ;Maximize kodi if Windowed.
        send, ^!{VK74} ; if kodi is Active (GSB Home Jump will activate)
        Return
        #IfWinActive ;


        Return
            ;Written by EliteGamer360, Please give credit When you Copy and use my scripts for any other purpose.
            ;Copyright @ kodiCUSTOMREGIS.SOURCEFORGE.NET
Reply
#2
Or, you could just use this tool, to remap any keys on your remote, thereby skipping the script you are using.
https://www.howtogeek.com/247332/how-to-...ce-remote/

Using this Advanced MCE Remote Mapper Tool, I've never had it lose focus.
Reply
#3
cheers looks the goods will give it a go!

How do i get it to open kodi tho? 
i have disabled the script and now nothing works so how do i define that button to open kodi? i can only see options to change the shortcut key...?
do i just setup a shortcut key for kodi and use that for that button?

because if so it doesn't seem to be working.
Reply

Logout Mark Read Team Forum Stats Members Help
Opening Kodi with harmony remote but its not the active window0