The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

How to Remote Control Button : More Info

Last post 12-16-2009, 8:38 AM by cambelious. 28 replies.
Page 2 of 2 (29 items)   < Previous 1 2
Sort Posts: Previous Next
  •  02-09-2007, 10:22 AM 1726 in reply to 1725

    Re: How to Remote Control Button : More Info

    Damm it, this is not working either.

    Actually, I can receive the commands from the remote control in a separate application, but as long as I keep the focus. If media center has the focus, my application no longer receives the commands.

  •  02-09-2007, 1:22 PM 1727 in reply to 1726

    Re: How to Remote Control Button : More Info

    albain,

    I'll see if I can find the code I wrote - you are on the right track, you just have a setting wrong but I can't remember which one it is.  With the correct setting you receive the commands regardless of whether you have focus or not.   It's spooky but it sounds like you've gone exactly through the exact steps I went through (sorry I didn't catch it earlier and save you the time).

    Cheers,
    Andrew

  •  02-10-2007, 2:47 AM 1736 in reply to 1727

    Re: How to Remote Control Button : More Info

    Thanks you very much Andy, I have been spending a lot of time on this problem.

    I think I found how to do it : setting rid[x].dwFlags = RIDEV_INPUTSINK;

    Still, it is only working for WM_INPUT messages, not for WM_APPCOMMAND.

    If you know how to catch WM_APPCOMMAND messages (which regroup play/pause/fast forward...), I will be thanksful !

  •  02-10-2007, 6:46 AM 1739 in reply to 1736

    Re: How to Remote Control Button : More Info

    Try setting dwFlags to 0 rather than RIDEV_INPUTSINK

    Cheers,
    Andrew

  •  02-10-2007, 7:02 AM 1740 in reply to 1739

    Re: How to Remote Control Button : More Info

    Finally found my bit of code - you're right it only seems to work for the non-transport keys.  I'll have a look and see if its possible to get those too.

    Cheers,
    Andrew

  •  02-12-2007, 2:55 AM 1750 in reply to 1740

    Re: How to Remote Control Button : More Info

    Thanks for your answer.

    I finally found how to map all the keys : I had to create a MFC dll with a call to SetWindowsHookEx, with a WH_SHELL hook, and filtered HSHELL_APPCOMMAND messages.

    By this way, I am able to catch the commands from the remote to the media center application.

    And indeed, it can't be done inside the addin, because media center catches the commands before when it has the focus.

    This is crazy how complicated it is. I thought that it would be easier than that :-)
  •  05-22-2007, 9:55 AM 3412 in reply to 1750

    Re: How to Remote Control Button : More Info

    It is a pity that the info button is not easily hooked. I noticed mention earlier in the thread of usability studies. During my time at NDS and most of the other companies in the set top field I have been in for the last 15 years or so the info button was always easily understood in our user test cases. If a couple million Sky and DirecTV users can figure out the information-related buttons on their remotes... :-).


    Cheers
    Kon
  •  05-22-2007, 10:03 AM 3414 in reply to 3412

    Re: How to Remote Control Button : More Info

    KonW, it's not that users can't figure things out. Rather it's the fact many users never think to use the More Information button. If you want the feature to be used, don't bury it under a context sensitive button. :-)
    Charlie Owen (Microsoft)
  •  08-25-2008, 5:09 AM 8219 in reply to 3414

    Re: How to Remote Control Button : More Info

    Hi!

    I just want to ask if any progress has been done in this "matter"? I find it astonishing to read that developers have gotten their hands tied by Redmond for a feature so heavily used all over the Vista Media Center. I use the (info) button like 30 times every day, to remove recordings, to watch more info for something. For example in the picture gallery if I want to remove a picture, the natural thing to do is to press (info) and select remove and press ok. And if you use the mouse, right click and press delete.

    As I and a friend of mine are working on a movie gallery app, we want the user to be able to play, remove, watch more info etc by selecting a movie in the gallery and press (info) and do whatever he wants.

    You state that it is better to put this functionality as a button and not hidden in a context menu. This is ridicolous I think, if I want some functionality to be specific to a certain kind of movie (like if the movie is in the dvd recorder I want the option to eject) why should I have a myriad of buttons on my user interface that I have to hide/show based on what kind of movie I have currently selected.

    So basically what you are saying is that the kind of functionality that exists everywhere in vista media center has been taken away for future development because your *studies* showed that poeple doesnt use it.... so i guess in Windows 7 there will be no use for the (info) button?

    kind regards

    Steven

  •  08-25-2008, 6:04 AM 8221 in reply to 8219

    Re: How to Remote Control Button : More Info

    MrSteve:
    So basically what you are saying is that the kind of functionality that exists everywhere in vista media center has been taken away for future development because your *studies* showed that poeple doesnt use it.... so i guess in Windows 7 there will be no use for the (info) button?

    Haha, well said.

    Anyway, you can trap the [i] button and use it for what you want. It just requires a bit more work than setting up a <KeyHandler /> or <ShortcutHandler />.

    myTV v1.2 (going into a semi-public beta today) does offer the use of [i] for a number of functions. This is done by running an external winforms application (started by the AddIn at launch - killing itself once the AddIn dies) listening for the appropriate remote button - this is then intercepted and forwarded to ehexthost (well, to the active application really) as a different keystroke. This keystroke is then trapped in MCML by use of a KeyHandler. The original [i] functionality is also preserved as the original message is still sent.

    It's definitely a hack, and TBQH not a very elegant one, but since everyone (and I mean everyone) was screaming for the use of [i] in the application it was implemented.


  •  08-25-2008, 6:16 AM 8222 in reply to 8221

    Re: How to Remote Control Button : More Info

    Hi!

    So this means that you have to be a real hacker in order to make simple use of the info button? A tutorial or "how to" in this matter would be really appreciated since I think many developers like myself have problems with this.

    Also, about the context menu itself, how is this built? I can see several steps in order to make a working context menu (info-menu)

    1) Intercept the right click or press on (i) button

    2) make the parent window toned down and "out of focus"

    3) Draw a  menu at the proper location and make it look "in focus"

    4) Fill the menu with buttons (probably by using a repeater or a simple panel with buttons in vertical flow)

    5) Add handlers for each and every one of the buttons, in my case for play, delete, movie details etc)

    6) Close the context menu and ame the parent window in focus

    If someone has already accomplished this, some whitepaper or tutorial would be great. I fail to see the point in 10 developers sitting and reinventing the wheel over and over again :)

    All the graphics for the native context menu exists in ehres.dll... so it is just a matter of MCML-coding ;)

    One thing I have learned so far is that as an MCML programmer you really need to be able to have a vivid imagination and an ability to "make something out of nothing"... since nothing is pre-packed and working out of the box. And the MSDN documentation is really bad.

    kind regards

    Steven 

  •  08-25-2008, 6:32 AM 8223 in reply to 8222

    Re: How to Remote Control Button : More Info

    I probably wont go into more detail about how the [i] handler is done than I did above, that being said - all the information you need to get this working was included in my above comment :)

    As for the context menu itself, I don't know how it's done in VMC native, but what I did to achieve this;


    was to create a parent UI including a couple <Host> elements, one for the main page (as can be seen on the top image) and one for the popup (which can be seen on the bottom image) and some keyhandlers to allow the popup to ... err, pop-up or go away again.

    At the same time, if App.PopupVisible == true, the main Host element will scale down and have a slight alphafade applied.

    Of course, you don't have to go thru all that trouble - you could simply create it [the context menu] as a separate UI and include that in your parent by <comm:CMenu ... Visible="Hidden" /> and toggle the visibility from a single rule.


  •  08-25-2008, 7:17 AM 8225 in reply to 8223

    Re: How to Remote Control Button : More Info

    Hi!

    Thanks for the info, I guess the capture of the info button is kind of a secret :)

    As for the context menu, I think I will just create a simple UI and try and add the buttons. And add a nice scale down and alpha fade and possible a gradient clip also for the same effect as in media center.

    Lots of new things to learn here, very exciting but yet very complicated. I think someone could earn money creating reusable UI elements like buttons, contextmenus etc so that every developer doesn't have to build everything from scratch.

    I don't suppose you have a link to some *good* MSDN documentation that provide some more info on how to work with two user elements that will have different focus? So far I have found this documentation that talks a little about ContentChangeShow and ContentHideShow. Perhaps it can be of some use when it comes to scaling down and focus the UI elements. It is located here.

    http://msdn.microsoft.com/en-us/library/bb189455.aspx

    Btw your app looks really nice! I like the way you added the sorting scroller. Dod you follow any particular tutorial or did u add a basic repeater with selectable items? I looked a little at the Z example when I built mine, but it can be improved a lot...

    kind regards

    Steven 

  •  12-16-2009, 8:38 AM 9509 in reply to 8225

    Re: How to Remote Control Button : More Info

    I have tried using the info on this thread to trap the more info button... but I can only trap the Media buttons using WH_SHELL..

    I created a C++ DLL and wrapped it using C#...

    Above it says "I finally found how to map all the keys : I had to create a MFC dll with a call to SetWindowsHookEx, with a WH_SHELL hook, and filtered HSHELL_APPCOMMAND messages."

    I have done all that using the code from http://www.koders.com/cpp/fidFFF35CB9EBFCE2C5C7C44E301FF267F5753DBB1B.aspx?s=SetWindowsHookEx#L76. It hooks all the media keys (like play pause ect) but not the more info button. Using the hook WH_SHELL wont trigger an event when I press the more info button on the remote.

    Any ideas? 
Page 2 of 2 (29 items)   < Previous 1 2
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems