Loading ...
Sorry, an error occurred while loading the content.

Re: [perlguitest] Re: Need help to finish the project

Expand Messages
  • vidhut singh
    Hey dude, I just read ur problem may be i can help u. use following function for sending SCROLL SetForegroundWindow($hand); SendMouse {SCROLL} ; $hand-
    Message 1 of 3 , Nov 3, 2006
    • 0 Attachment
      Hey dude,
      I just read ur problem may be i can help u.
      use following function for sending SCROLL

      SetForegroundWindow($hand);
      SendMouse "{SCROLL}";
      $hand-> handle of the window on whic scroll operation is being performed

      and regarding ur second problem Alt+shift keys ..
      Go through :)

      SendKeys( $keys, $delay );
      Parameters



      $keys
      Keystrokes to be send to a window having input focus

      $delay
      [Optional] delay between keys strokes


      Remarks


      The keystrokes to send are specified in KEYS. There are several characters that have special meaning. This allows sending control codes and modifiers:

      ~ means ENTER

      + means SHIFT

      ^ means CTRL

      % means ALT


      The parens allow character grouping. You may group several characters, so that a specific keyboard modifier applies to all of them.
      E.g. SendKeys("ABC") is equivalent to SendKeys("+(abc)")
      The curly braces are used to quote special characters (SendKeys("{+}{{}") sends a '+' and a '{'). You can also use them to specify certain named actions:
      Name Action {BACKSPACE} Backspace {BS} Backspace {BKSP} Backspace {BREAK} Break {CAPS} Caps Lock {DELETE} Delete {DOWN} Down arrow {END} End {ENTER} Enter (same as ~) {ESCAPE} Escape {HELP} Help key {HOME} Home {INSERT} Insert {LEFT} Left arrow {NUMLOCK} Num lock {PGDN} Page down {PGUP} Page up {PRTSCR} Print screen {RIGHT} Right arrow {SCROLL} Scroll lock {TAB} Tab {UP} Up arrow {PAUSE} Pause {F1} Function Key 1 ... ... {F24} Function Key 24 {SPC} Spacebar {SPACE} Spacebar {SPACEBAR} Spacebar {LWI} Left Windows Key {RWI} Right Windows Key {APP} Open Context Menu Key
      All these named actions take an optional integer argument, like in {RIGHT 5}. For all of them, except PAUSE, the argument means a repeat count. For PAUSE it means the number of milliseconds SendKeys should pause before proceeding.
      In this implementation, SendKeys always returns after sending the keystrokes. There is no way to tell if an application has processed those keys when the function returns.





      Philip Zembrod <Philip.Zembrod@...> wrote:
      >
      >
      >
      > Posted by: "tpham1002002" tpham1002002@...
      > <mailto:tpham1002002@...?Subject=Re:%20Need%20help%20to%20finish%20the%20project>
      > tpham1002002 <http://profiles.yahoo.com/tpham1002002>
      >
      >
      > Thu Nov 2, 2006 8:41 pm (PST)
      >
      > I am writing a Perl script to test a KVM to switch between 2 PCs (it
      > is my sister's school project). If I press Scroll key twice and then
      > number 1 or 2 key it will switch to 1st pr 2nd PC respectively.
      > I am using the function
      > SendKeys("{SCROLL}{SCROLL}{1}") or SendKeys("{SCROLL}{SCROLL}{2}")
      > only the scroll light is up and it prints out 1 or 2 on the log file
      > but the switch doesn't move.

      I cannot imagine how mouse events sent inside one of the two switched
      PCs should reach the switch. I.e. I think you cannot test a KVM with
      Win32:GuiTest.

      > Another thing is I don't know why SendKeys("^%{DELETE}") (Ctrl + Alt +
      > Delete) doesn't work in scripting.

      Ctrl-Alt-Del issues an NMI as far as I know, and I would expect this to
      happen in the keyboard controller chip, not inside Windows.

      Regards
      Philip






      ---------------------------------
      Find out what India is talking about on - Yahoo! Answers India
      Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.