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/30/2009 7:20:05 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Yesterday @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
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.



Kindest Regards,
SmartCode Solutions Support
Post #2498
Posted 4/30/2009 7:36:18 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 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
Posted 4/30/2009 8:30:31 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 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
Posted 5/1/2009 4:10:59 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Yesterday @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
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.



Kindest Regards,
SmartCode Solutions Support

  Post Attachments 
vncKeymap.txt (200 views, 11.57 KB)

Post #2501
Posted 5/1/2009 10:31:37 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
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
Posted 5/1/2009 10:42:01 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Yesterday @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
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.




Kindest Regards,
SmartCode Solutions Support

Post #2509
Posted 5/4/2009 10:33:15 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
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
« 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 7:08pm

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.234. 7 queries. Compression Disabled.