SmartCode Solutions Web Forum




SendCustomKey and Windows Key

Author Message
 Posted Thursday, April 30, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 3 hours ago
Posts: 1,582, Visits: 2,954
I'll give it a try in the morning (10.20PM in Singapore now) and post my test results. I'll run UltraVNC Server under a debuger and check if it processes the Windows key correctly.

http://www.s-code.com/App_Themes/Default/images/blue_line.gif
We are looking for investors and business partners. Please contact us for more details

Kindest Regards,
SmartCode Solutions Support
Post #2498
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
I have tested this viewer issue with RealVNC server and UltraVNC server, it displays the same problem on both. 

Hope this info helps.

M

Post #2499
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
I also figured a work around to my problem, which was to create short cuts on the desktop and assign them Shortcut keys such as CTRL+ALT_Num2, if I press the keys on the keyboard it works perfectly, if I used SendCustomKeyEx as below, nothing happens.

Its definitely seems to be a problem with the function.

     Me.vwr_Main.SendCustomKeyEx(KeySym_Control_L, True)
     Me.vwr_Main.SendCustomKeyEx(KeySym_Alt_L, True)
     Me.vwr_Main.SendCustomKeyEx(Keys.NumPad2, True)
     Me.vwr_Main.SendCustomKeyEx(Keys.NumPad2, False)
     Me.vwr_Main.SendCustomKeyEx(KeySym_Alt_L, False)
     Me.vwr_Main.SendCustomKeyEx(KeySym_Control_L, False)

Thanks

M

Post #2500
Add to Twitter Add to Facebook
 Posted Friday, May 01, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 3 hours ago
Posts: 1,582, Visits: 2,954
Bad news....it looks like a VNC server doesn't process Windows key events. Look at the file attached. If you familiar with C++ you will see that their key map processing class works only with scan codes defined in the static keymap_t keymap[] array plus ordinary Latin-1 characters. The Windows key is not defined in the array. 

Look at the method void keyEvent(CARD32 keysym, bool down, vncServer *server)  Line:254, the main processing logic is implemented by this method.

Probably if you add scan code for the Windows key to the keymap array and recompile  VNC server sources you will get it working.

Unfortunately there is noting can be done about the problem on the ViewerX side, since this is a missing VNC server feature we are dealing here.

http://www.s-code.com/App_Themes/Default/images/blue_line.gif
We are looking for investors and business partners. Please contact us for more details

Kindest Regards,
SmartCode Solutions Support


 vncKeymap.txt (217 views, 11.57 KB)

Post #2501
Add to Twitter Add to Facebook
 Posted Friday, May 01, 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
My browser failed, so I am not sure if you got this post or not.

If the server doesnt process the windows key, why does the following code cause the windows start menu to open?

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, True)

Me.vwr_Main.SendCustomKeyEx(KeySym_Windows_L, false)

 

Also why doesnt CTRL+ALT+Key work?

Me.vwr_Main.SendCustomKeyEx(KeySym_Control_L, True)

Me.vwr_Main.SendCustomKeyEx(KeySym_Alt_L, True)

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

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

Me.vwr_Main.SendCustomKeyEx(KeySym_Alt_L, False)

Me.vwr_Main.SendCustomKeyEx(KeySym_Control_L, False)

 

This code doesnt launch the shortcut with this keyboard shortcut setup, but if I physically press the keys it does.

 

Thanks

M

Post #2505
Add to Twitter Add to Facebook
 Posted Friday, May 01, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 3 hours ago
Posts: 1,582, Visits: 2,954
I got it working! Apparently TightVNC server (which I was using for testing) doesn't support Windows key, but UltraVNC server does.
The trick is order in which scan codes are sent. The following works for me and opens the Run window:

vx.SendCustomKeyEx(65515, true);
System.Threading.Thread.Sleep(100);
vx.SendCustomKeyEx(65515, false);
System.Threading.Thread.Sleep(100);
vx.SendCustomKeyEx(0x052, false);
System.Threading.Thread.Sleep(100);
vx.SendCustomKeyEx(0x052, true);

Now you might be wondering what those Sleep(100) are doing the code. At least in my case, without them I was getting some random results; in some case the start menu would open and in some cases the Run window. Adding the Sleep call seems to fix the issue.


http://www.s-code.com/App_Themes/Default/images/blue_line.gif
We are looking for investors and business partners. Please contact us for more details

Kindest Regards,
SmartCode Solutions Support

Post #2509
Add to Twitter Add to Facebook
 Posted Monday, May 04, 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
Thank you very much for you help with this, its greatly appreciated.  I have purchased the control based on having made it work here.

Thanks

M

Post #2510
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse