The VNC Manager - SmartCode Solutions Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


12»»

SendCustomKey and Windows Key Expand / Collapse
Author
Message
Posted 4/24/2009 2:34:34 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/23/2009 2:47:13 PM
Posts: 10, Visits: 27
How can I use SendCustomKey to send the Windows Key down to the client?

Specifically I am trying to do a WindowsKey + R to get a run dialog and be able to run commands automatically through my application.

I also believe that SendCustomKeyEx is what I need to be able to hold the WindowsKey and get key combinations.  Is this true?  I believe SendCustomKeyEx is not available in the trial version, is there another way I can test this before purchasing the control?

Thanks

M

Post #2487
Posted 4/25/2009 6:47:56 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
You are correct SendCustomKeyEx is the way to go. The ServerX build available for download from the main site doesn't have this method implemented.

Here is the download link for the upcoming ServerX build with SendCustomKeyEx:
http://www.s-code.com/download/beta/scvncctrl_sendcustomkeyex.zip



Kindest Regards,
SmartCode Solutions Support

Post #2489
Posted 4/26/2009 1:49:59 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/23/2009 2:47:13 PM
Posts: 10, Visits: 27
Sorry, I should have specified, I am using the viewer control not the server control.

Is there a viewer build that has the SendCustomKeyEx in it?

thanks

M

Post #2490
Posted 4/26/2009 3:29:15 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/23/2009 2:47:13 PM
Posts: 10, Visits: 27
Also what is the KeyCode for the Windows Key?

Thanks

M

Post #2491
Posted 4/27/2009 12:27:34 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
Sorry, I should have specified, I am using the viewer control not the server control.

Is there a viewer build that has the SendCustomKeyEx in it?


Actually it was my mistake, when I wrote ServerX I actually meant ViewerX. So the download URL points to a ViewerX build with SendCustomKeyEx in it.

With regards of the Windows key. I'm trying to find out its scan code but so far I haven't found it. You see, for ViewerX it doesn't matter what code you are sending via SendCustomKeyEx, it simply sends it to a VNC server. So its up to VNC server to interpret this code and process it.

Attached is a source code file from UltraVNC distribution with the list of scan codes supported by UVNC server.
It might be a good idea to ask UVNC developers via forum.ultravnc.com about what's the Windows key scan code is.



Kindest Regards,
SmartCode Solutions Support

  Post Attachments 
keysymdef.txt (169 views, 66.78 KB)

Post #2492
Posted 4/28/2009 1:14:26 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/23/2009 2:47:13 PM
Posts: 10, Visits: 27
This is great info, I have added the updated DLL and have SendCustomKeyEx but cannot get the windows key (65515) to work.

What I am looking for is the WinKey+R combination to get me a run dialog.  But the Windows Key doesnt seem to work properly.  ALT+F4 works as expected, it seems to be a Windows Key Issue, which I beleive is called XK_Super_L in the doc you provided, at least according to the research I did.

Here is the code I am using:

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, True)

Me.vwr_Main.SendCustomKeyEx(Keys.R, True)

Is there something I am missing?  I seem to get the R to go through but not the combination.

Thanks

M

Post #2493
Posted 4/28/2009 8:23:38 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
A key press event consists of two event: key down and key up event. So you should call SendCustomKeyEx twice, one time for key down and another for key up. You code should look like this:

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, True)
Me.vwr_Main.SendCustomKeyEx(Keys.R, True)
Me.vwr_Main.SendCustomKeyEx(Keys.R, False)
Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, False)




Kindest Regards,
SmartCode Solutions Support

Post #2494
Posted 4/29/2009 9:02:23 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/23/2009 2:47:13 PM
Posts: 10, Visits: 27
I understand how it works now, but I still cant get a windows key combination to work.

This works, it brings up the windows menu like it should.

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, True)

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, False)

 

This doesnt work however:

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, True)

Me.vwr_Main.SendCustomKeyEx(Keys.R, True)

Me.vwr_Main.SendCustomKeyEx(Keys.R, False)

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, False)

 

Neither does this:

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, True)

Me.vwr_Main.SendCustomKeyEx(Keys.R, True)

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, False)

Me.vwr_Main.SendCustomKeyEx(Keys.R, False)

 

Or this:

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, True)

Me.vwr_Main.SendCustomKey(Keys.R)

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, False)

 

I've tried everything I can think of, either I am missing something or maybe we have a bug?

Thanks

M

Post #2495
Posted 4/30/2009 6:10:05 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
Could you please send me which scan code do you use for the Windows key and where did you find one? I'll try to reproduce the problem locally. But with 100% certainty I can guaranty that this is not an issue with ViewerX, since it merely sends scan codes to a VNC server.



Kindest Regards,
SmartCode Solutions Support
Post #2496
Posted 4/30/2009 7:08:38 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 9/23/2009 2:47:13 PM
Posts: 10, Visits: 27
If you google KeySym and "Windows Key" you will find dozens of descriptions of the Super L (65515) and Super R keys being the windows Key.

http://www.google.ca/search?hl=en&q=keysym+%22Windows+Key%22&meta=&aq=f&oq=

If you use a

Me.vwr_Main.SendCustomKeyEx(65515, True)

Me.vwr_Main.SendCustomKeyEx(65515, False)

you will get the windows start menu just like the windows key should do.  And we know the R works so its an issue with the combination of keys for sure.

Although ALT + F4 works:

Me.vwr_Main.SendCustomKeyEx(KeySym_Alt_L, True)

Me.vwr_Main.SendCustomKeyEx(KeySym_F4, True)

Me.vwr_Main.SendCustomKeyEx(KeySym_F4, False)

Me.vwr_Main.SendCustomKeyEx(KeySym_Alt_L, False)

 

Rather unfortunate that the windows key combinations dont work as that was the point to why I wanted to replace a precompiled VNC viewer with my own.

Please let me know what you find out.

Thanks

M

Post #2497
« Prev Topic | Next Topic »

12»»

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Support (s-code), Alex (s-code)

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 6:38am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.313. 9 queries. Compression Disabled.