SendCustomKey and Windows Key


Author
Message
mrowley
mrowley
Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)
Group: Forum Members
Posts: 11, 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

Yury Averkiev (s-code)
Yury Averkiev (s-code)
Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)
Group: Administrators
Posts: 1.9K, Visits: 3.6K
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

http://www.s-code.com/App_Themes/Default/images/blue_line.gif
Regards,

Yury Averkiev, SmartCode

mrowley
mrowley
Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)
Group: Forum Members
Posts: 11, 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

mrowley
mrowley
Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)
Group: Forum Members
Posts: 11, Visits: 27
Also what is the KeyCode for the Windows Key?

Thanks

M

Yury Averkiev (s-code)
Yury Averkiev (s-code)
Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)
Group: Administrators
Posts: 1.9K, Visits: 3.6K
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.

http://www.s-code.com/App_Themes/Default/images/blue_line.gif
Regards,

Yury Averkiev, SmartCode

Attachments
keysymdef.txt (634 views, 66.00 KB)
mrowley
mrowley
Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)
Group: Forum Members
Posts: 11, 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


Yury Averkiev (s-code)
Yury Averkiev (s-code)
Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)
Group: Administrators
Posts: 1.9K, Visits: 3.6K
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)


http://www.s-code.com/App_Themes/Default/images/blue_line.gif
Regards,

Yury Averkiev, SmartCode

mrowley
mrowley
Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)
Group: Forum Members
Posts: 11, 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


Yury Averkiev (s-code)
Yury Averkiev (s-code)
Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)Supreme Being (213K reputation)
Group: Administrators
Posts: 1.9K, Visits: 3.6K
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.

http://www.s-code.com/App_Themes/Default/images/blue_line.gif
Regards,
Yury Averkiev, SmartCode

mrowley
mrowley
Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)Supreme Being (2.2K reputation)
Group: Forum Members
Posts: 11, 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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Explore
Messages
Mentions
Search