Remote control any app using virtual keys

title says it all

Remote control any app using virtual keys

Postby bobbo on Sun May 14, 2006 11:52 pm

I just put these instructions in my BeyondTV post, but since it is universal to all applications that use hotkeys, I thought I would repeat the info:

* Using http://www.windows-spy.com/ or similar, find the "Class Name" and "Window Name" for the program you want to control. For BeyondTV, these were "Streamzap.WM.D3D" and "Beyond TV".

* Write down the shortcut keys (e.g. pause=space bar). Then look up the virtual key ID's on MSDN (e.g. space bar = 0x20 hex = 32 decimal).

* Create a "send message" event in XLobby:

Class Name = Streamzap.WM.D3D
Window Name = Beyond TV
Message = WM_KEYDOWN
wParam = 32
iParam = 0

* If you wanted to be really picky, you ought to send a WM_KEYDOWN, wait 100ms, then a WM_KEYUP to simulate a real key press. This is necessary if your app has a shift+key types of combination (e.g. for Alt+Enter, use this sequence: keydown Alt, keydown Enter, keyup Enter, keyup Alt).

* Click "Test" to test to see XLobby remote control your application!
bobbo
 
Posts: 5
Joined: Sat Jun 18, 2005 11:53 pm

Postby Twit on Mon May 15, 2006 4:58 pm

Great work! Should come in handy.
Twit
 
Posts: 258
Joined: Thu Nov 20, 2003 4:14 am
Location: South Africa

Postby hvs69 on Tue May 16, 2006 3:39 pm

Thanks.

It is good to know that there is another program besides girder that can be used to find window_class_name.
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby chaumurky on Tue Jul 25, 2006 2:56 pm

Has anyone tried this with WebScheduler's keyboard interface in Internet Explorer running in fullscreen mode? For a "Down" keypress I'm using the following:

Class Name = IEFrame
Window Name = http://localhost/servlet/ApplyTransform ... sl=kb-root - Microsoft Internet Explorer
Message = WM_KEYDOWN
wParam = 40
iParam = 0

No success - in girder either.
chaumurky
 
Posts: 14
Joined: Mon Jul 17, 2006 3:18 am
Location: Annandale, Australia.

Postby S Pittaway on Tue Jul 25, 2006 5:17 pm

try sending a keyup as well.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby chaumurky on Wed Jul 26, 2006 6:14 am

No luck. I suppose I should try to get it working with Girder first. In the past I've just sent keypresses to the focused window but that can't be done with xlobby can it?
chaumurky
 
Posts: 14
Joined: Mon Jul 17, 2006 3:18 am
Location: Annandale, Australia.

Postby S Pittaway on Wed Jul 26, 2006 11:14 am

that sounds like a really simple one line plugin to me...

i am busy at the moment, or i would knock one up :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby chaumurky on Wed Jul 26, 2006 12:24 pm

Yes it would be a very useful event to have at one's disposal. There is a DTV program called DNTVLive! that I use which has no window classname so it would also help in this case. See here:

http://forums.dvbowners.com/index.php?showtopic=3776
chaumurky
 
Posts: 14
Joined: Mon Jul 17, 2006 3:18 am
Location: Annandale, Australia.

Postby chaumurky on Wed Jul 26, 2006 1:10 pm

Actually, perhaps I could just set the page in a browser screen - I still need to navigate wth simulated keystrokes I guess. It seens that arrow keys just scroll.
chaumurky
 
Posts: 14
Joined: Mon Jul 17, 2006 3:18 am
Location: Annandale, Australia.

Postby art on Thu Jul 27, 2006 1:02 am

S Pittaway wrote:that sounds like a really simple one line plugin to me...

i am busy at the moment, or i would knock one up :)


Well, I had some time this afternoon, so I knocked it up :) ...

chaumurky,
If you still interested, download this file.
Like Sean said it's just one line plug-in based on SendKeys, so if you want to send some combo keys like ctrl+A which would be ^A or backspace {BS} check this page, it should explain how to do it http://msdn2.microsoft.com/en-us/librar ... dkeys.aspx
art
 
Posts: 284
Joined: Sat Mar 20, 2004 8:40 am
Location: Allen, TX

Postby chaumurky on Fri Jul 28, 2006 12:23 am

Well it works beautifully. I wanted to use the same navigation keys on my remote so i added xSendKey events to the existing xlobby navigation events - of course then I got double events when xlobby is in focus so I removed the xlobby navigation events and it works well!! Can anyone see potential problems with me just using this new plugin to navigate xlobby in such a way? I use the Girder/xRemote combination to trigger these events and while I could just send keys to focused apps from Girder, I find it a more stable combination this way and would prefer to keep my gml simple. Thanks for your efforts. I'm going to let the guys know over at http://forums.dvbowners.com/ , this will be very helpful.

EDIT: I'm not having any success with DNTVLive! unfortunately. I just want to send channel change keys ^U and ^D but it's not working on this occasion. I wonder what could be wrong here.
chaumurky
 
Posts: 14
Joined: Mon Jul 17, 2006 3:18 am
Location: Annandale, Australia.

Postby art on Fri Jul 28, 2006 10:33 pm

Try this. I had this code in my other plug-in, so I just had to copy it...
Anyway, I was able to test it a little bit on DNTVLive! like changing to DVD mode etc. and it worked for me. I don't have a card, so that's all I could do.
Last edited by art on Tue Mar 20, 2007 6:35 pm, edited 1 time in total.
art
 
Posts: 284
Joined: Sat Mar 20, 2004 8:40 am
Location: Allen, TX

Postby chaumurky on Sun Jul 30, 2006 3:20 am

Perfect. I re-mapped the nav commands for the new plugin, then the channel change CTRL:U and CTRL:D for DNTVLive! and it all works well. I just need to get xlobby to come to the front on startup - i still have to bring it to the front to be able to navigate. It's probably winamp stealing focus or something but i imagine that will be easy to fix but for now i have an 'ALT-TAB' button on my remote so I've created and mapped an 'ALT:TAB' SendKey event. Well done. This fills the only real issue i had with xlobby. It's now running full time on my HTPC. :)

EDIT: That's solved now too. Just set winamp to minimize to the tray when it starts...
http://www.xlobby.com/forum/viewtopic.php?p=30585#30585
chaumurky
 
Posts: 14
Joined: Mon Jul 17, 2006 3:18 am
Location: Annandale, Australia.

Postby stevodude on Sat Aug 12, 2006 12:59 am

so after all that, you have DNTVLive working with xlobby?

I want to do the same thing, but I need a bit of pointing in the right direction...

what TV plugin did you use?
what skin did you use
how do you use the xskeys.dll file

cheers, stevo.
stevodude
 
Posts: 2
Joined: Thu Aug 10, 2006 5:39 am

Postby art on Sun Aug 13, 2006 11:15 pm

stevodude wrote:so after all that, you have DNTVLive working with xlobby?

I want to do the same thing, but I need a bit of pointing in the right direction...

what TV plugin did you use?
what skin did you use
how do you use the xskeys.dll file

cheers, stevo.


I can't answer your first two questions, but as far as #3 - don't use xskeys, instead see this page, for some reason xskeys didn't work with DNTVLive.
Last edited by art on Thu Mar 22, 2007 1:25 pm, edited 1 time in total.
art
 
Posts: 284
Joined: Sat Mar 20, 2004 8:40 am
Location: Allen, TX

Next