SmartCode Solutions Web Forum




SendCustomKey and Windows Key

Expand / Collapse
Author Message
 Posted Friday, April 24, 2009
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Wednesday, September 23, 2009
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
Add to Twitter Add to Facebook
 Posted Saturday, April 25, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 4:49 PM
Posts: 1,248, Visits: 2,125
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
Add to Twitter Add to Facebook
 Posted Sunday, April 26, 2009
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Wednesday, September 23, 2009
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
Add to Twitter Add to Facebook
 Posted Sunday, April 26, 2009
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Wednesday, September 23, 2009
Posts: 10, Visits: 27
Also what is the KeyCode for the Windows Key?

Thanks

M

Post #2491
Add to Twitter Add to Facebook
 Posted Monday, April 27, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 4:49 PM
Posts: 1,248, Visits: 2,125
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


 keysymdef.txt (179 views, 66.78 KB)

Post #2492
Add to Twitter Add to Facebook
 Posted Tuesday, April 28, 2009
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Wednesday, September 23, 2009
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
Add to Twitter Add to Facebook
 Posted Tuesday, April 28, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 4:49 PM
Posts: 1,248, Visits: 2,125
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
Add to Twitter Add to Facebook
 Posted Wednesday, April 29, 2009
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Wednesday, September 23, 2009
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
Add to Twitter Add to Facebook
 Posted Thursday, April 30, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 4:49 PM
Posts: 1,248, Visits: 2,125
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
Add to Twitter Add to Facebook
 Posted Thursday, April 30, 2009
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Wednesday, September 23, 2009
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
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse