Kodi Community Forum
[WINDOWS] HOW-TO use MCE remote in XBMC under Windows the easy way - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: [WINDOWS] HOW-TO use MCE remote in XBMC under Windows the easy way (/showthread.php?tid=78179)



- M3Rocket - 2011-05-17

Hey EG!

I also found that the WinMaximize command in the AutoHotkey script doesn't work as expected. The backslash key ("\") toggles the fullscreen mode of XBMC. If XBMC is not fullscreen, WinMaximize only maximizes the window, but doesn't put XBMC back into fullscreen. I rewrote portions of the script to send the backslash key if XBMC isn't running in fullscreen. Here is the modified script:

Code:
;Win-Alt-Enter is the shortcut for greenbutton_Win32bit
;by elitegamer360, modified by M3Rocket
#!Enter::
    IfWinNotExist XBMC.exe ;If XBMC is shutdown
        Run C:\Program Files\XBMC10\XBMC.exe ;Start it
        WinWait,XBMC,,5 ;wait for 5 seconds for it
        If ErrorLevel ;Display an error in case it times out.
        {
            MsgBox, XBMC Startup timed out.
            Return
        }
    WinActivate ;Activate the window, in case the it's in the background.
    WinShow ;Bring it to front.
    WinGet, Style, Style, ahk_class XBMC
    if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
    {
        SendPlay {SC02B}  ;Make XBMC fullscreen by sending the backslash key
    }
    Return

    SetTitleMatchMode 2 ;Search string
    #IfWinActive XBMC ahk_class XBMC ; Detect when XBMC is active
    #!Enter::
        WinGet, Style, Style, ahk_class XBMC
        if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
        {
                SendPlay {SC02B}  ;Make XBMC fullscreen by sending the backslash key
        }
        send, ^!{F5} ; if Active (GSB Home Jump will activate)
    Return



- elitegamer360 - 2011-05-17

M3Rocket Wrote:Hey EG!

I also found that the WinMaximize command in the AutoHotkey script doesn't work as expected. The backslash key ("\") toggles the fullscreen mode of XBMC. If XBMC is not fullscreen, WinMaximize only maximizes the window, but doesn't put XBMC back into fullscreen. I rewrote portions of the script to send the backslash key if XBMC isn't running in fullscreen. Here is the modified script:

Code:
;Win-Alt-Enter is the shortcut for greenbutton_Win32bit
;by elitegamer360, modified by M3Rocket
#!Enter::
    IfWinNotExist XBMC.exe ;If XBMC is shutdown
        Run C:\Program Files\XBMC10\XBMC.exe ;Start it
        WinWait,XBMC,,5 ;wait for 5 seconds for it
        If ErrorLevel ;Display an error in case it times out.
        {
            MsgBox, XBMC Startup timed out.
            Return
        }
    WinActivate ;Activate the window, in case the it's in the background.
    WinShow ;Bring it to front.
    WinGet, Style, Style, ahk_class XBMC
    if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
    {
        SendPlay {SC02B}  ;Make XBMC fullscreen by sending the backslash key
    }
    Return

    SetTitleMatchMode 2 ;Search string
    #IfWinActive XBMC ahk_class XBMC ; Detect when XBMC is active
    #!Enter::
        WinGet, Style, Style, ahk_class XBMC
        if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
        {
                SendPlay {SC02B}  ;Make XBMC fullscreen by sending the backslash key
        }
        send, ^!{F5} ; if Active (GSB Home Jump will activate)
    Return

Thanks for your efforts M3Rocket Big Grin

I tried this in the past but I abandoned it, simply because it does not work on multi-screen modes and NOTE that the script is not to blame but XBMC never returns to the original screen that it was set to! So I did not bother, lol. The second issue is not major, but using "sendplay" and the code "{SC02B}" is not really optimum for use with XBMC although I am not an expert in this field but this never works on all Windows systems. If I were you I would just use this instead "Send {VKDC}" becuase it will 100% work in all systems instead of just using "SendPlay {SC02B}".

Thanks again, I'll modify the script in the next release :-)

Cheers,
EG.


- rugbymad - 2011-05-19

YOU ARE A GOD!!!!!!!!!!!!!!!!!!!!!!
this has been the easiest thing ever on XBMC. I have struggled with some other stuff and expected this to be a nightmare... soooooooo easy and it works. INFACT IT'S LIKE RONSEAL.... IT DOES EXACTLY WHAT IT SAYS ON THE TIN.....

Thank you...............

a wee question though... the coloured button for eg blue. how do i make this switch to explorer menu. the red one to start skype and the yellow to internet explorerHuh is it easy for a numpty.. lol


- elitegamer360 - 2011-05-19

rugbymad Wrote:YOU ARE A GOD!!!!!!!!!!!!!!!!!!!!!!
this has been the easiest thing ever on XBMC. I have struggled with some other stuff and expected this to be a nightmare... soooooooo easy and it works. INFACT IT'S LIKE RONSEAL.... IT DOES EXACTLY WHAT IT SAYS ON THE TIN.....

Thank you...............

You are most welcome, I'm Glad you are happy with the setup Big Grin

rugbymad Wrote:a wee question though... the coloured button for eg blue. how do i make this switch to explorer menu. the red one to start skype and the yellow to internet explorerHuh is it easy for a numpty.. lol

Yes this should be very easy to do! There are coupe of ways to do it, but the neatest way is to add aditional script to the autohotkey script you already have.

eeerrrm, "switch to explorer menu" not really sure what you mean by this can you be more specific please.

Now the best way to do it is to change what the "Blue, Yellow and Red" buttons send so that they will not interfere with XBMC.

1- use MCERemoteMapper.exe to change what the "Blue, Yellow and Red" buttons send. I suggest you do as follows:
"Blue" set it to "Control+Alt+A"
"Yellow" set it to "Control+Alt+B"
"Red" set it to "Control+Alt+C"
as such
Image
Click Apply to apply settings, EXIT then Restart.


Then just copy this script to your current GSB Script:
1- On your Windows Taskbar right click on your GSB Script and select Edit this script.

Copy and paste the script shown below right under your current script.

Code:
        ^!VK41::
        Run C:\Program Files (x86)\FlashFXP\FlashFXP.exe
        ;Hit "Ctrl+Alt+A" "MCE Blue Button" to start "FlashXP"
        Return

        ^!VK42::
        Run C:\Program Files\Internet Explorer\iexplore.exe
        ;Hit "Ctrl+Alt+B" "MCE Yellow Button" to "Internet Explorer"
        Return
        
        ^!VK43::
        Run C:\Program Files (x86)\Skype\Skype.exe
        ;Hit "Ctrl+Alt+C" "MCE Red Button" to start "Skype"
        Return
as such
Image



Before you save and exit, Just note that I set the "Yellow" button to start Internet Explorer like you wanted. Now I set the blue button to start flashxp just as an example because I did not understand what you meant by the "explorer menu".

And for the yellow button, just double check where your skype.exe is installed then change the line in BOLD to whatever the location on your PC
Code:
        [i]^!VK43::[/i]
        Run [b]C:\Program Files (x86)\Skype\Skype.exe[/b]
        [i];Hit "Ctrl+Alt+C" "MCE Red Button" to start "Skype"
        Return[/i]

When you do all the changes SAVE then exit notepad, go back to your taskbar and right click on the GSB script icon then select "Reload This Script" to apply the new settings.

I hope that does not sound too complicated, but if you tell me what is the "Explorer Menu" that you are referring to and where your Skype.exe is installed then I will mod the script and give it to you ready to be used.

Cheers,
EG.


- rugbymad - 2011-05-20

Thx elitegamer, I'll try that tonight, by explorer i just ment the desktop. soz i should have just said desktop.. I managed to get it finally fitted to my tv last night and had a play with everything.. when i had eventghost running the remote when i pressed the off button the pc went to sleep, but now it goes to the exit menu screen ..
i take it i do something simular like above to make it sleep..


chees again


- elitegamer360 - 2011-05-20

rugbymad Wrote:Thx elitegamer, I'll try that tonight, by explorer i just ment the desktop. soz i should have just said desktop.. I managed to get it finally fitted to my tv last night and had a play with everything.. when i had eventghost running the remote when i pressed the off button the pc went to sleep, but now it goes to the exit menu screen ..
i take it i do something simular like above to make it sleep..


chees again

Thats better thank you :-)

Regarding the Power button I've set it to XBMC Power menu because you can configure exactly what you want in XBMC. But if you want it to send your PC to sleep then do as follows:- We are going to use the conventional way of editing the the reg file manually instead of using MCEremotemapper :-)

1- On your Keybopard hit "Win+R" keys to start the "Run" dialogue, then paste %AppData%\Xbmccustomregis\ and hit OK. It should open "Xbmccustomregis" installation folder.

2- Right click on "Config.v1.25.reg" and select "Edit"

[Power Button]
3- Look for
Code:
0c,00,00,00,04,00,16,\ ; [Power]         - Sends "S"

4- Change it to
Code:
0c,00,00,00,03,82,00,\ ; [Power]         - Sends "PC to Sleep"

[Blue Button]
5- look for
Code:
5E,00,00,00,04,00,1a,\ ; [Blue]           - Sends "W"

6- change it to
Code:
5E,00,00,00,04,08,07,\ ; [Blue]           - Sends "Win-D"

[Yellow Button]
7- look for
Code:
5D,00,00,00,04,01,1C,\ ; [Yellow]        - Sends "Ctrl-Y"

8- change it to
Code:
5D,00,00,00,04,05,05,\ ; [Yellow]        - Sends "Ctrl-Alt-B"

[Red Button]
9- look for
Code:
5B,00,00,00,04,00,2b,\ ; [Red]        - Sends "TAB"

1- change it to
Code:
5B,00,00,00,04,05,06,\ ; [Red]        - Sends "Ctrl-Alt-C"

Save and exit notepad. Double click on the config file to apply the new settings. It will require a restart but will restart later.

Now Move to the GSB Script before restarting! Use the script below instead of the one posted above. We only need the last two because the blue button is sorted already.
Code:
        ^!VK42::
        Run C:\Program Files\Internet Explorer\iexplore.exe
        ;Hit "Ctrl+Alt+B" "MCE Yellow Button" to "Internet Explorer"
        Return
        
        ^!VK43::
        Run C:\Program Files (x86)\Skype\Skype.exe
        ;Hit "Ctrl+Alt+C" "MCE Red Button" to start "Skype"
        Return

So copy this script and paste it below your current GSB script, just double check that the "Skype" installation location is correct, if so then SAVE, close notepad and Now finally restart your PC.

Now this edit should do what you want, you can now backup your Config.v1.25.reg because if you ever want to install Xbmccustomregis again and want your old settings again you can just apply Config.v1.25.reg over it to load your custom settings.

I hope this helps.

Cheers,
EG.


- rugbymad - 2011-05-20

MY HERO!!!!!! THX you have been the most helpfull person ever.... cheers..

i looked for a donate link on your web site but none that i could see...

thx again .. i'll let you know how it goes.. just hope wife goes to bed early so i can get on it..


- floepie - 2011-05-23

Thanks for the write-up. Recently, my registry reverted back to the stock table values. Has that happened to anyone else here?

Oh, and if XBMC is minimized, it won't be maximized with the script from the OP, at least on my W7 build.


- elitegamer360 - 2011-05-23

floepie Wrote:Thanks for the write-up. Recently, my registry reverted back to the stock table values. Has that happened to anyone else here?

Oh, and if XBMC is minimized, it won't be maximized with the script from the OP, at least on my W7 build.

This shouldn't happen! Unless your windows registry is totally messed up somehow, that windows had to revert to last known good restore, which obviously stopped your registry setup and GSB script from working correctly.

Thats what I think anyways! but NO, this should never happen if your Windows is stable.

Cheers,
EG.


- stolek5 - 2011-05-31

Hi,

I'm wondering if it's possible to map the download subtitle add-on dialog to below remote button:

Image

this button is visible in ShowKey:

Image

I've tried map a key to multiple command to download subtitles for movie, now I must press:
1. "m" button
2. "up row" button
3. "right row" button
4. "enter" button

Image

Do I need modify keyboard.xml in location:
C:\Users\Moni\AppData\Roaming\XBMC\userdata\keymaps ?

or it's possible different method ?

this is for laptop HP Pavilion dv6000 with Windows 7 32-bit installed.

thanks for any help


- elitegamer360 - 2011-06-01

stolek5 Wrote:Hi,

I'm wondering if it's possible to map the download subtitle add-on dialog to below remote button:

Image

this button is visible in ShowKey:

Image

I've tried map a key to multiple command to download subtitles for movie, now I must press:
1. "m" button
2. "up row" button
3. "right row" button
4. "enter" button

Image

Do I need modify keyboard.xml in location:
C:\Users\Moni\AppData\Roaming\XBMC\userdata\keymaps ?

or it's possible different method ?

this is for laptop HP Pavilion dv6000 with Windows 7 32-bit installed.

thanks for any help

This is very easy to do and not too complicated, I use it myself instead of using "on/off" subtitles trigger button.

Make sure XBMC is not running when you do this! Now what you need to do is open %AppData%\XBMC\userdata\keymaps which the same as C:\Users\Moni\AppData\Roaming\XBMC\userdata\keymaps hence the first can be plugged in the windows run command program and it will open the right folder for you.

then if you are using my custom keyboard.xml then open it to edit it and then search for
Code:
<t>ShowSubtitles</t>
the first result should be under
Code:
<Keymap>
  <FullscreenVideo>
    <keyboard>
Now copy the script below
Code:
<key id='61695'>XBMC.RunScript("C:\Users\Moni\AppData\Roaming\XBMC\addons\script.xbmc.subtitles\default.py")</key>
and paste it right under <t>ShowSubtitles</t> save and exit.

Well if you do not have a keyboard.xml in your "userdata\keymaps" folder then create a new one or use your own custom one if it exist. you will need to copy and paste the script below in it.
Code:
<keymap>
           <FullscreenVideo>
               <keyboard>
                  <key id='61695'>XBMC.RunScript("C:\Users\Moni\AppData\Roaming\XBMC\addons\script.xbmc.subtitles\default.py")</key>
               </keyboard>
           </FullscreenVideo>
        </keymap>

NOTE: if nothing in your keyboard.xml then leave the script as is but if there are something in it then copy the script without the <keymap> and </keymap> parts because you should already have one in the begining and one at the end respectively.

Now run XBMC and it should work, Note it will only work under "Fullscreen video" as noted above, if you want to run it not just in the "FullscreenVideo" then put the script in the "Global" section instead. Also note that you can use it now with any skin even with the ones that does not have the subtitle script shortcut in the Video OSD menu.

Hope this helps.

Cheers,
EG.


- stolek5 - 2011-06-01

thank you so much,

I will try today evening and let you know about my results Smile

thanks again !!


- floepie - 2011-06-01

I thought I would add something that you may or may not know about. I use a harmony remote to control all devices within a programmed "activity". When switching to a different "activity", all the unused devices from the previous "activity" are switched off. However, if the PC doesn't receive the 'power toggle' command from the remote properly, the PC can turn ON when it was intended to be turned OFF and vice versa. The PC is my only device without dedicated POWER ON and POWER OFF commands.

In order to fix this, I simply changed the MCE remotes 'red' button to the power toggle command in the registry. Now, you might think that I have two separate Power Toggle switches, but what I wind up with is one normal Power Toggle and one Power OFF (red button), because when the PC sits in standby, it responds ONLY to the Power Toggle button and not to the 'red' button.

So, in the Harmony software, I set the new Power On command to the normal Power Toggle button and the Power Off command to the 'red' button. Now, I have a dedicated Power ON and Power OFF buttons, just as all the other devices now have.


- elitegamer360 - 2011-06-01

stolek5 Wrote:thank you so much,

I will try today evening and let you know about my results Smile

thanks again !!

No worries, this should work fine for you :-)

Cheers,
EG.


- stolek5 - 2011-06-01

elitegamer360 Wrote:No worries, this should work fine for you :-)

Cheers,
EG.

unfortunately doesn't work Sad nothing happened after press that button, also I can't find any thing related in debug log Sad

this is my keyboard.xml

also I've tried with new keyboard.xml with only:

Code:
<keymap>
           <FullscreenVideo>
               <keyboard>
                  <key id='61695'>XBMC.RunScript("C:\Users\Moni\AppData\Roaming\XBMC\addons\script.xbmc.subtitles\default.py")</key>
               </keyboard>
           </FullscreenVideo>
        </keymap>

but still the same Sad

do you know what could be wrong ?

pls help...