Results 1 to 4 of 4

Thread: Holding a button down.

  1. #1
    Join Date
    Jun 2009
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Holding a button down.

    How can I make it keep a button held down for a certain amount of time using:

    Code:
    SendKeys('1');
    ?

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    SCAR Code:
    KeyDown(WhateverKey);
    Wait(What time you want to wait);
    KeyUp(WhateverKey);

  3. #3
    Join Date
    Jun 2009
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by senrath View Post
    SCAR Code:
    KeyDown(WhateverKey);
    Wait(What time you want to wait);
    KeyUp(WhateverKey);
    Oh, that's like one the things I should've remembered. In that case The KeyDown and KeyUp functions take their ascii values, right?

    Edit, is it possible to do a wait until something, to do KeyUp? Or would I just like.. repeat a 1ms Wait loop until the conditional statement (color) I want changes? Either way you can provide a simple syntax example? Thanks.
    Last edited by Al3x8730; 06-18-2009 at 03:21 AM.

  4. #4
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Yeah, they take the ascii values.

    Anyway, it's easy to do something like that. Like this:
    SCAR Code:
    KeyDown(Something);
    repeat
      Wait(100 + random(50));
    until (Conditional)
    KeyUp(Something);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •