Jump to content
C4 Forums | Control4

Controlling a PC in C4


zaphod

Recommended Posts

What's the best way to control a PC running Windows 10 with a C4 remote?  Using the Windows Media Center driver?  Will that allow you to map a button to "Ctrl-Escape" which is equivalent to pressing the windows key?  That then allows you to use the transport keys to select items on the Win 10 tiled start screen, including Netflix, etc.

Link to comment
Share on other sites


23 minutes ago, msgreenf said:

Windows media center no longer is part of win 10
 

I know, but I have an older remote that is a Windows media center remote and my HTPC has an IR receiver built into it.   Microsoft used to sell these remotes in conjunction with IR receivers (that also had blaster connectivity). I am pretty sure that the drivers for this still work in Win 10.  And this is the only C4 driver I found that looks applicable

But are there other ways that make more sense when you have a controller like C4 that has IP connectivity? Like maybe running a program on the PC that listens for commands on an IP socket that simultes a HID on the PC - assuming that there would be a C4 driver.  For example:  MCE Controller - https://github.com/tig/mcec/wiki 

I am guessing that there isn't a driver for MCE Controller or anything similar in Control4?

Link to comment
Share on other sites

MCE Controller looks for interesting.  I think I will try to adapt an existing Media Player driver in Control4 to send commands that work with MCE Controller.

On a PC as a server it opens a raw TCP socket and listens for commands.  If you send it "winkey" that simulates the Windows Key on a PC which brings up the menu on Win 10.  You can then send "up", "down", etc that are the equivalent of direction keys.  It also easily acepts the transport keys. Sending "Mute" to the socket has it execute VK_VOLUME_MUTE on the PC.

No wonder MCE Controller makes sense for this purpose:

Quote

MCE Controller was initially developed to enable integration of a Windows based home theater PC (HTPC) into a Crestron whole-house audio/video system. However, it is general enough that others have used it within other control system that support sending text strings to a TCP/IP port. 

 

Link to comment
Share on other sites

17 hours ago, zaphod said:

MCE Controller looks for interesting.  I think I will try to adapt an existing Media Player driver in Control4 to send commands that work with MCE Controller.

On a PC as a server it opens a raw TCP socket and listens for commands.  If you send it "winkey" that simulates the Windows Key on a PC which brings up the menu on Win 10.  You can then send "up", "down", etc that are the equivalent of direction keys.  It also easily acepts the transport keys. Sending "Mute" to the socket has it execute VK_VOLUME_MUTE on the PC.

No wonder MCE Controller makes sense for this purpose:

 

My MCE remote came with a usb IR receiver. I still have it.  Is there a way to control it through DNLA or would that limit what you could actually do to the windows environment? 

Link to comment
Share on other sites

I don't know h

51 minutes ago, ecschnei said:

My MCE remote came with a usb IR receiver. I still have it.  Is there a way to control it through DNLA or would that limit what you could actually do to the windows environment? 

You mean DLNA? I am not sure - what are you looking to do?

Link to comment
Share on other sites

18 hours ago, zaphod said:

MCE Controller looks for interesting.  I think I will try to adapt an existing Media Player driver in Control4 to send commands that work with MCE Controller.

It was fairly easy to whip together a proof of concept and start sending commands to my PC by adapting an existing C4 IP based media player driver.

This actually looks like a very powerful tool.  And the functionality goes way beyond controlling a Media Center PC. It should be fairly easy to write a driver to control a PC including running programs on your PC - not unlike the Chowman Generic TCP command driver. 

Link to comment
Share on other sites

One basic thing is to be able to start Netflix from the Win 10 tile menu.  This is easy to do as long as you can send the Windows key which is also Ctrl-Escape.  Once that menu is up you just need directional keys.  Being able to send any of the Media keys would also be usefult control playback of various 

Link to comment
Share on other sites

22 hours ago, zaphod said:

It was fairly easy to whip together a proof of concept and start sending commands to my PC by adapting an existing C4 IP based media player driver.

Which driver did you start with as a base? I'm happy to throw some development time at this as well, I agree it would be a useful drive to have. Maybe not for many of our customers, but certainly in my own system!

Link to comment
Share on other sites

I used a driver for SageTV that was IP based - I was familiar with this driver as I adapted it to create a new SageTV driver.  But I think this may have come from an XBMC driver.  Take a look at the MCE Controller docs on Github - it is pretty flexible as you can send all sorts of commands from media commands (Play, Pause, Mute, Vol+, etc) to start application commands to mouse clicks.  And you just send them as raw text - I was using Putty to send commands to the MCE Controller server.  Then within putty if you type "Mute" you can see that the MCE Controller received something like "VK_VOLUME_MUTE"

 

Link to comment
Share on other sites

Good suggestion Ryan - that seems quite similar to MCE Controller in terms of functionality although EventGhost is acting as a web server and MCE Controller is just listening for raw commands on a port.

Here's some of the docs from the EventGhost Wiki:  http://www.eventghost.net/mediawiki/index.php/Webserver

And here is some Groovy code from GitHub for SmartThings:  https://github.com/aderusha/SmartThings/blob/master/Send-Events-to-EventGhost.groovy

Link to comment
Share on other sites

It really is pretty trivial to do, either with C4:SendToNetwork for sockets or C4:urlGet for Eventghost.  The main work will be in mapping keys on a C4 controller to the commands you want on the PC.  It might make sense to have most, or all of them, be Properties that can be changed in Composer.

Maybe the best way to even do this is to create a generic driver where you enter a URL prefix and port as Properties.  You also have all of the keyboards mapped to commands in Properties.  Then you could use this for pretty much anything.  You could also add a suffix in case some apps needed that as well.

g_URLPrefix="http://192.168.1.149/myapp?command="

 

 

Link to comment
Share on other sites

7 minutes ago, zaphod said:

It really is pretty trivial to do, either with C4:SendToNetwork for sockets or C4:urlGet for Eventghost.  The main work will be in mapping keys on a C4 controller to the commands you want on the PC.  It might make sense to have most, or all of them, be Properties that can be changed in Composer.

Maybe the best way to even do this is to create a generic driver where you enter a URL prefix and port as Properties.  You also have all of the keyboards mapped to commands in Properties.  Then you could use this for pretty much anything.  You could also add a suffix in case some apps needed that as well.

g_URLPrefix="http://192.168.1.149/myapp?command="

 

 

that would be cool just harder for dealers to use

Link to comment
Share on other sites

Yes, it would be nice if you could come up with a text or csv file that you could use as the command mapping table that then gets imported into Properties.  Is something like that possible?

Something like this (although I am not sure these are the correct EventGhost Actions)

C4 Remote Key	EventGhost Action
Play			{MediaPlay}
Cncl			Keyboard.Escape
Blue			Keyboard.Ctrl-Escape
Left			{Left}

 

Link to comment
Share on other sites

1 minute ago, zaphod said:

Yes, it would be nice if you could come up with a text or csv file that you could use as the command mapping table that then gets imported into Properties.  Is something like that possible?

Something like this (although I am not sure these are the correct EventGhost Actions)


C4 Remote Key	EventGhost Action
Play			{MediaPlay}
Cncl			Keyboard.Escape
Blue			Keyboard.Ctrl-Escape
Left			{Left}

 

no way today to do that I am aware of.  maybe @seth_j knows something 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.