Programs that interfere with the remote (iTunes, Chrome)

A place to talk about GPUs/Motherboards/CPUs/Cases/Remotes, etc.
Post Reply
crawfish

Posts: 465
Joined: Fri Jan 13, 2012 5:16 am
Location:

HTPC Specs: Show details

Programs that interfere with the remote (iTunes, Chrome)

#1

Post by crawfish » Tue Jun 24, 2014 9:42 pm

It seems this topic has been coming up with more regularity, and now Chrome is reported to interfere just like iTunes. Are there any others?

I used to work around the iTunes problem by setting up Autohotkey to close iTunes when I launched WMC or XBMC, which I never liked, because I wanted to keep iTunes running so it would be available for Apple TVs, the Remote App on iPhones, etc. While I still have AHK shut down XBMC when I launch WMC and vice versa, I no longer have it shut down iTunes. Now I avoid the iTunes problem by configuring all my remote buttons to send F13-F24 combinations, and my main AHK file includes "bindings files" for WMC, XBMC, VLC, Potplayer, etc that detect when those programs have the focus and translate the F13-F24 combinations into the right shortcut keys for them. Also involved is the ReportMappingTable registry entry, which is filled with all these F13-F24 combinations instead of the usual keys, and because I have a bunch more buttons I want to use than I have buttons on my Microsoft remote, I use RMIR and a JP1 remote to get those buttons into my Sony RM-VL610. I also use Excel to help keep all the mappings straight. I've been doing this for several years, and my WMC system is my primary PC I use for everything except gaming. It's complicated, but once set up, It Just Works.

Here is a minimal solution for WMC to the specific keys that I recall iTunes interfering with, that I extracted from my working setup. If anyone wants to see the fully realized crazy implementation, I can collect it into a zip file and post it here. The method works in Windows 7 and 8 for the standard MCE remote and Microsoft receiver. I don't do extenders and would be interested to learn if it works with them.

NB: You will need a fully realized crazy implementation for each program you operate with the remote. What I'm posting below is a proof-of-concept for WMC, and it will render the buttons I'm overriding useless in other programs unless bindings are defined for them. You will need to restore your original ReportMappingTable to get back to normal (where remember, iTunes and Chrome interfere :lol:).

Here's the ReportMappingTable excerpt:

Code: Select all

;;;;; Begin ReportMappingTable excerpt. Replace the corresponding lines
;;;;; in your own ReportMappingTable with these, but save a backup of
;;;;; course so that you can revert. If you need a standard .reg file formatted
;;;;; to make this replacement easier, I can post one. I found that Windows 7
;;;;; and 8 come with identical ReportMappingTables. Remember to reboot after
;;;;; merging the .reg files. 

14,00,00,00,04,00,68,\ ; [FF]				F13
15,00,00,00,04,00,69,\ ; [RW]				F14
16,00,00,00,04,00,6a,\ ; [Play]				F15
17,00,00,00,04,00,6b,\ ; [Record]			F16
18,00,00,00,04,00,6c,\ ; [Pause]			F17
19,00,00,00,04,00,6d,\ ; [Stop]				F18
1a,00,00,00,04,00,6e,\ ; [Next]				F19
1b,00,00,00,04,00,6f,\ ; [Prev]				F20
23,00,00,00,04,00,70,\ ; [Back]				F21
0f,00,00,00,04,00,71,\ ; [Info]				F22

;;;;; End ReportMappingTable excerpt 
Now the Autohotkey excerpt:

Code: Select all

;;;;; Begin AHK excerpt. Add this to a .ahk file and run it, and for long
;;;;; term use, drop it or a shortcut to the .ahk file into your Startup
;;;;; folder so it will run when you boot.

; Begin with the preamble from my real script.

#NoEnv
#LTrim
#SingleInstance force

#WinActivateForce
SendMode Input
SetTitleMatchMode 1 ; At start

return

; Now the WMC bindings for the buttons we're overriding in ReportMappingTable.
; In my real script, this is in a separate text file the main script #includes,
; and there are separate binding files for WMC, XBMC, etc, and they are all
; much more extensive.

#IfWinActive ahk_class eHome Render Window

F13:: ; [FF]
	ModWait()
	Send ^+f
	return
F14:: ; [RW]
	ModWait()
	Send ^+b
	return
F15:: ; [Play]
	ModWait()
	Send ^+p
	return
F16:: ; [Rec]
	ModWait()
	Send ^r
	return
F17:: ; [Pause]
	ModWait()
	Send ^p
	return
F18:: ; [Stop]
	ModWait()
	Send ^+s
	return
F19:: ; [Skip Forward]
	ModWait()
	Send ^f
	return
F20:: ; [Skip Back]
	ModWait()
	Send ^b
	return
F21:: ; [Back]
	ModWait()
	Send {BackSpace}
	return
F22:: ; [Info]
	ModWait()
	Send ^d
	return

#IfWinActive

/* ModWait

Used after a hotkey has been triggered, this waits for all modifier keys to be released. I do this because
sometimes I found the Shift or Ctrl keys would be left in the pressed state after the hotkey had been
processed, which I would notice when selecting text in an editor or files in Explorer with the mouse. For
whatever reason, using the KeyWait function seems to clear this state, and it's simplest just to do them
all, as it doesn't hurt anything if they aren't pressed. The only downside is that the hotkey action isn't
performed until all the keys are released, but you'd only notice it when using a keyboard, and it's not a big
deal even then IMO.

You really need to do this if you're using Media Center, which is just flaky. XBMC OTOH works fine whether
you do it or not. For example, in Media Center, sending the Alt+Enter command to switch between full-screen
and windowed mode does not work reliably without it.
*/

ModWait()
{
	KeyWait Shift
	KeyWait Ctrl
	KeyWait Alt
	KeyWait LWin
	KeyWait RWin
}

;;;;; End AHK excerpt

crawfish

Posts: 465
Joined: Fri Jan 13, 2012 5:16 am
Location:

HTPC Specs: Show details

#2

Post by crawfish » Wed Jun 25, 2014 10:52 pm

Here is a complete ReportMappingTable .reg file that replaces the buttons I mentioned in my first post. It is otherwise the same as what came standard with my Windows 7 and 8. Again, this is for the "RC6 based MCE remote" as you would see if you looked at the "RemoteName" value under the registry key the file modifies. Here's a summary of what you need to do if you want to try this, which of course is completely reversible:

1. Make a backup copy of your ReportMappingTable. See registry file below for the name of the key to look at.
2. Save the code section below to a .reg file and merge it into the registry. Reboot so it will take effect.
3. Install Autohotkey if necessary, save the script from the previous post to a .ahk file, and run the .ahk file. AHK will put an icon in the notification area representing the running script.
4. Test your remote and verify iTunes and Chrome no longer eat the Play/Pause/Stop/Rec/FF/Rew/Replay/Skip/Back/Info buttons, which are the buttons this cut-down test version overrides. As I mentioned in my first post, these buttons will only work in WMC with this cut-down version. The full version enables them for XBMC and other programs I use. It's extensible to any program controllable with keyboard shortcuts.
5. To restore what you started with, merge your backup ReportMappingTable into the registry and reboot so it will take effect.
6. Let me know if it works with extenders or if you would be interested in the full version which handles WMC and XBMC and adds things like short and long commercial skip functions, automatically closes XBMC when WMC is started and vice versa, which could be easily extended to other programs, etc. It'll take more effort to put the full version together for public release, which is why I'm asking for feedback before proceeding.

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da]
"ReportMappingTable"=hex:\
00,00,00,00,04,00,27,\ ; [0]			0
01,00,00,00,04,00,1e,\ ; [1]			1
02,00,00,00,04,00,1f,\ ; [2]			2
03,00,00,00,04,00,20,\ ; [3]			3
04,00,00,00,04,00,21,\ ; [4]			4
05,00,00,00,04,00,22,\ ; [5]			5
06,00,00,00,04,00,23,\ ; [6]			6
07,00,00,00,04,00,24,\ ; [7]			7
08,00,00,00,04,00,25,\ ; [8]			8
09,00,00,00,04,00,26,\ ; [9]			9
0a,00,00,00,04,00,29,\ ; [Clear]		Esc
0b,00,00,00,04,00,28,\ ; [Enter]		Enter
0c,00,00,00,03,82,00,\ ; [Power]
0e,00,00,00,01,e2,00,\ ; [Mute]
10,00,00,00,01,e9,00,\ ; [Vol+]
11,00,00,00,01,ea,00,\ ; [Vol-]
12,00,00,00,01,9c,00,\ ; [Ch+]
13,00,00,00,01,9d,00,\ ; [Ch-]
14,00,00,00,04,00,68,\ ; [FF]				F13
15,00,00,00,04,00,69,\ ; [RW]				F14
16,00,00,00,04,00,6a,\ ; [Play]				F15
17,00,00,00,04,00,6b,\ ; [Record]			F16
18,00,00,00,04,00,6c,\ ; [Pause]			F17
19,00,00,00,04,00,6d,\ ; [Stop]				F18
1a,00,00,00,04,00,6e,\ ; [Next]				F19
1b,00,00,00,04,00,6f,\ ; [Prev]				F20
23,00,00,00,04,00,70,\ ; [Back]				F21
0f,00,00,00,04,00,71,\ ; [Info]				F22
1c,00,00,00,04,02,20,\ ; [#]			Shift+3
1d,00,00,00,04,02,25,\ ; [*]			Shift+8
1e,00,00,00,04,00,52,\ ; [Up]			Up Arrow
1f,00,00,00,04,00,51,\ ; [Down]			Down Arrow
20,00,00,00,04,00,50,\ ; [Left]			Left Arrow
21,00,00,00,04,00,4f,\ ; [Right]		Right Arrow
22,00,00,00,04,00,28,\ ; [OK]			Enter
26,00,00,00,01,8d,00,\ ; [Guide]
29,00,00,00,03,83,00,\ ; [Wake]
2a,00,00,00,03,82,00,\ ; [Sleep]
3b,00,00,00,01,04,02,\ ; [Close]
4e,00,00,00,01,08,02,\ ; [Print]
6e,00,00,00,01,cd,00,\ ; [Play/Pause]

Post Reply