Forum Discussion

hokrani's avatar
hokrani
Contributor
14 years ago

Not able to type Keys in cosole mode.

What is Problem ?

 I have VMware Remote Console. In this I need to type 12 i.e. numeric key 1 and 2


I follow the below steps:

1.  To take control in the console I need to Press Ctrl+G (see Screen shot Pict1.jpg file)


Using the following code… I achieved this steps.


Dim  objVM


Set objVM =Aliases.vmware_vmrc


objVM.wndVirtualEmbedded.Keys("^g")


2.       Now I need to type  numeric  key 12. I use the following code :


objVM.wndVirtualEmbedded.Keys("12") ‘Failed to type it


objVM.wndVirtualEmbedded.Keys("[12]") ‘Failed to type it


objVM.wndVirtualEmbedded.Keys("[~12]") ‘Failed to type it


 

See screen shot pict2.jpg file. 



Let me know how to solve this problem.

5 Replies


  • Hi Hoks,





    Try using a combination of the KeyDown and KeyUp methods calls after the console is focused:





      ' ...

      Sys.Desktop.KeyDown(0x31)

      Sys.Desktop.KeyUp(0x31)

      Sys.Desktop.KeyDown(0x32)

      Sys.Desktop.KeyUp(0x32)

      ' ...



  • Hi Allen,

          When i'm having tough time, u will help me so u are God for me!!!  



    What is Problem ?

                     Method like 'KeyDown' and 'KeyUp' are not supported for my object i.e. Aliases.vmware_vmrc.wndVirtualEmbedded



    So let me know how to solve it using any other method.



    Regards,

    Hoks


  • Hi Hoks,



    Method like 'KeyDown' and 'KeyUp' are not supported for my object i.e. Aliases.vmware_vmrc.wndVirtualEmbedded



    That's correct. These methods are members of the Desktop object. Do you face any issues if you accurately follow the advice from my previous post?

  • No, i'm not able to type in console after its focused ( according to ur pervious post ).
  • Hi Hoks,



    Use the Object Spy window to capture the window object highlighted in the image attached to my post. After that, replace "<Window>" with the value of the captured window's FullName property in the following routine and execute it:



    Sub Test


      Dim o


      Set o = <Window>


      Call o.Click


      Call Sys.Desktop.KeyDown(&h31)


      Call Sys.Desktop.KeyUp(&h31)


      Sys.Desktop.KeyDown(&h32)


      Sys.Desktop.KeyUp(&h32)


    End Sub




    If such an approach does not accomplish your task, please describe the behavior you observe when executing this routine.