Forum Discussion

Gadzilla's avatar
Gadzilla
Contributor
14 years ago

Sys.Desktop.KeyUp() does not work on XP platform

In my test cases I need to click some icon in the system tray by the right-mouse button with pressed right shift key.

I am use the following code:



...


Sys.Desktop.KeyDown(Win32API.VK_RSHIFT);

BuiltIn.Delay(500);

SystemTrayIcons.ClickItemR(myIconLabel + "*", false);

BuiltIn.Delay(500);

Sys.Desktop.KeyUp(Win32API.VK_RSHIFT);

....



This code works perfect on all Windows platforms exclude XP Pro. 

After execution of this code on XP Pro all other clicks executed with pressed Shift key. Looks like Sys.Desktop.KeyUp works not correctly on XP platform.



I also try to execute the following code Sys.Desktop.Keys("![ReleaseLast]") instead of using "KeyUp" method, but this is also not work.



Could someone help me to solve the problem?

5 Replies

  • Answer was not helpful and the problem still actual.

    Any suggestion will be appreciated!



    Thanks.





  • Hi,





    As we cannot reproduce the problem, I can only suggest a workaround:

    Try using the LLPlayer.KeyDown and LLPlayer.KeyUp methods instead of Sys.Desktop.KeyDown and Sys.Desktop.KeyUp:



    LLPlayer.KeyDown(Win32API.VK_RSHIFT, 100);

    BuiltIn.Delay(500);

    SystemTrayIcons.ClickItemR(myIconLabel + "*", false);

    BuiltIn.Delay(500); LLPlayer.KeyUp(Win32API.VK_RSHIFT, 100);



  • Hi Alex,



    Thanks for your answer, but looks like this approach also not work in my case.



    This approach works only in case I try to right-click icon in the system tray with pressed right-shift button for the first time. But attempt to right-click this icon second time (with 500 ms delay after first click) without! pressed right-shift key leads to opening the context menu, which should appear only in case icon was right-clicked with pressed right-shift key.



    Looks like this happens because of .KeyUp() does not work.



    Is somebody have idea how can I right-click by the icon in the system tray with pressed right-shift key?



    Thanks again.