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

SendKeys - Reserved characters (~)

Expand Messages
  • Nahum Cohen
    Hi, Is there an option to use the SendKeys function without the reserved characters manipulation ? I would like to type the characters ~+^ % to the screen.
    Message 1 of 7 , Sep 18, 2005
      Hi,

      Is there an option to use the SendKeys function without the reserved
      characters manipulation ?
      I would like to type the characters ~+^ % to the screen. Here is a sample
      code:

      use Win32::GuiTest qw(SendKeys);
      $foo = '~test';
      Win32::GuiTest::SendKeys("$foo");
      Win32::GuiTest::SendKeys("{ENTER}");

      I would like to send the keys ~test and not Enter -> test.

      Thanks,
      Nahum


      [Non-text portions of this message have been removed]
    • Piotr Kaluski
      Did you try curly braces? According to documentation, they should escape special characters (I did not try). Have a look
      Message 2 of 7 , Sep 18, 2005
        Did you try curly braces?
        According to documentation, they should escape special characters (I
        did not try). Have a look
        http://www.piotrkaluski.com/files/winguitest/docs/ch09s68.html
        -Piotr

        --- In perlguitest@yahoogroups.com, Nahum Cohen <nahum.cohen@g...> wrote:
        > Hi,
        >
        > Is there an option to use the SendKeys function without the reserved
        > characters manipulation ?
        > I would like to type the characters ~+^ % to the screen. Here is a
        sample
        > code:
        >
        > use Win32::GuiTest qw(SendKeys);
        > $foo = '~test';
        > Win32::GuiTest::SendKeys("$foo");
        > Win32::GuiTest::SendKeys("{ENTER}");
        >
        > I would like to send the keys ~test and not Enter -> test.
        >
        > Thanks,
        > Nahum
        >
        >
        > [Non-text portions of this message have been removed]
      • Nahum Cohen
        I tried this with no success: use Win32::GuiTest qw(SendKeys); $foo = ~test ; Win32::GuiTest::SendKeys( {$foo} ); ... [Non-text portions of this message have
        Message 3 of 7 , Sep 18, 2005
          I tried this with no success:

          use Win32::GuiTest qw(SendKeys);
          $foo = '~test';
          Win32::GuiTest::SendKeys("{$foo}");


          On 9/18/05, Piotr Kaluski <pkaluski@...> wrote:
          >
          > Did you try curly braces?
          > According to documentation, they should escape special characters (I
          > did not try). Have a look
          > http://www.piotrkaluski.com/files/winguitest/docs/ch09s68.html
          > -Piotr
          >
          > --- In perlguitest@yahoogroups.com, Nahum Cohen <nahum.cohen@g...> wrote:
          > > Hi,
          > >
          > > Is there an option to use the SendKeys function without the reserved
          > > characters manipulation ?
          > > I would like to type the characters ~+^ % to the screen. Here is a
          > sample
          > > code:
          > >
          > > use Win32::GuiTest qw(SendKeys);
          > > $foo = '~test';
          > > Win32::GuiTest::SendKeys("$foo");
          > > Win32::GuiTest::SendKeys("{ENTER}");
          > >
          > > I would like to send the keys ~test and not Enter -> test.
          > >
          > > Thanks,
          > > Nahum
          > >
          > >
          > > [Non-text portions of this message have been removed]
          >
          >
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >


          [Non-text portions of this message have been removed]
        • Ernesto Guisado
          ... This should work: use Win32::GuiTest qw(SendKeys); Win32::GuiTest::SendKeys( {~}test ); Cheers, E. -- http://erngui.com
          Message 4 of 7 , Sep 19, 2005
            > use Win32::GuiTest qw(SendKeys);
            > $foo = '~test';
            > Win32::GuiTest::SendKeys("{$foo}");

            This should work:

            use Win32::GuiTest qw(SendKeys);
            Win32::GuiTest::SendKeys("{~}test");

            Cheers,
            E.
            --
            http://erngui.com
          • Nahum Cohen
            This work indeed, but we miss the point: I don t know what is the scalar data. An optional work-around can be to check every character for the reserved keys ..
            Message 5 of 7 , Sep 19, 2005
              This work indeed, but we miss the point: I don't know what is the scalar
              data.
              An optional work-around can be to check every character for the reserved
              keys .. but this is only a work-around...



              On 9/19/05, Ernesto Guisado <erngui@...> wrote:
              >
              > > use Win32::GuiTest qw(SendKeys);
              > > $foo = '~test';
              > > Win32::GuiTest::SendKeys("{$foo}");
              >
              > This should work:
              >
              > use Win32::GuiTest qw(SendKeys);
              > Win32::GuiTest::SendKeys("{~}test");
              >
              > Cheers,
              > E.
              > --
              > http://erngui.com
              >
              >
              >
              >
              >
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
              >


              [Non-text portions of this message have been removed]
            • Piotr Kaluski
              I tend to disagree. I think the current approach is consistent with escaping characters in strings. n is a next line , but you can t expect this to work:
              Message 6 of 7 , Sep 19, 2005
                I tend to disagree. I think the current approach is consistent with
                escaping characters in strings. "\n" is a "next line", but you can't
                expect this to work:
                $string = "n"
                print "\$string";

                You have to explicitly state what do you escape:
                $string = "\n";
                print "$string";

                I am not trying to convince anyone that this is the best solution
                possible. My point is that SendKeys behaviour is consistent.

                -Piotr

                --- In perlguitest@yahoogroups.com, Nahum Cohen <nahum.cohen@g...>
                wrote:
                > This work indeed, but we miss the point: I don't know what is the
                scalar
                > data.
                > An optional work-around can be to check every character for the
                reserved
                > keys .. but this is only a work-around...
                >
                >
                >
                > On 9/19/05, Ernesto Guisado <erngui@a...> wrote:
                > >
                > > > use Win32::GuiTest qw(SendKeys);
                > > > $foo = '~test';
                > > > Win32::GuiTest::SendKeys("{$foo}");
                > >
                > > This should work:
                > >
                > > use Win32::GuiTest qw(SendKeys);
                > > Win32::GuiTest::SendKeys("{~}test");
                > >
                > > Cheers,
                > > E.
                > > --
                > > http://erngui.com
                > >
                > >
                > >
                > >
                > >
                > >
                > > Yahoo! Groups Links
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                >
                >
                > [Non-text portions of this message have been removed]
              • negedi
                it is perl...use regexpr...should be simple :-) ... scalar ... reserved
                Message 7 of 7 , Sep 19, 2005
                  it is perl...use regexpr...should be simple :-)

                  --- In perlguitest@yahoogroups.com, Nahum Cohen <nahum.cohen@g...>
                  wrote:
                  > This work indeed, but we miss the point: I don't know what is the
                  scalar
                  > data.
                  > An optional work-around can be to check every character for the
                  reserved
                  > keys .. but this is only a work-around...
                  >
                  >
                  >
                  > On 9/19/05, Ernesto Guisado <erngui@a...> wrote:
                  > >
                  > > > use Win32::GuiTest qw(SendKeys);
                  > > > $foo = '~test';
                  > > > Win32::GuiTest::SendKeys("{$foo}");
                  > >
                  > > This should work:
                  > >
                  > > use Win32::GuiTest qw(SendKeys);
                  > > Win32::GuiTest::SendKeys("{~}test");
                  > >
                  > > Cheers,
                  > > E.
                  > > --
                  > > http://erngui.com
                  > >
                  > >
                  > >
                  > >
                  > >
                  > >
                  > > Yahoo! Groups Links
                  > >
                  > >
                  > >
                  > >
                  > >
                  > >
                  > >
                  >
                  >
                  > [Non-text portions of this message have been removed]
                Your message has been successfully submitted and would be delivered to recipients shortly.