Results 1 to 12 of 12

Thread: hold key?

  1. #1
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    189
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default hold key?

    is there a way to hold a key down?
    i know to do it with mouse, but with a key... nope
    We merely play "against the rules". We cheat. Thats what we are good at, thats what we do.
    http://www.frement.net/srl/simba_user4.png

  2. #2
    Join Date
    Mar 2008
    Location
    Indiana
    Posts
    192
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    procedure HoldMouse(x, y: Integer; Left: Boolean);
    Holds mouse button. Set parameter Left to true for left button, false for right.

    procedure ReleaseMouse(x, y: Integer; Left: Boolean);
    Releases mouse button. Set parameter Left to true for left button, false for right.

    Those are from the Scar Manuel.


    Sry I read it wrong, Shuttle is right.

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    189
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    got it
    We merely play "against the rules". We cheat. Thats what we are good at, thats what we do.
    http://www.frement.net/srl/simba_user4.png

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you have to do Keydown(GetKey('x'));
    and KeyUp(GetKey('x'));

    don't you?

  6. #6
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    you have to do Keydown(GetKey('x'));
    and KeyUp(GetKey('x'));

    don't you?
    GetKeyCode*


  7. #7
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    you have to do Keydown(GetKey('x'));
    and KeyUp(GetKey('x'));

    don't you?
    no lol... look for the
    key values...
    (byte)

  8. #8
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    no lol... look for the
    key values...
    (byte)
    GetKeyCode returns the ascii key value.


  9. #9
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    i know... but you don't 'have' to use getkeycode, which is what he is saying. plus i was trying to help nielskool understand the function better!

  10. #10
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    To hold a key down you simply use this:
    SCAR Code:
    procedure HoldKey(key : char; howlong : integer);
    begin
      KeyDown(GetKeyCode(key));
      wait(howlong);
      KeyUp(GetKeyCode(key));
    end;

    No credit needed...
    To use it do this
    SCAR Code:
    HoldKey('n', 1000); // 'n' is the key you want to press, 1000 is how long you want it to hold it, in milliseconds

  11. #11
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    To hold a key down you simply use this:
    SCAR Code:
    procedure HoldKey(key : char; howlong : integer);
    begin
      KeyDown(GetKeyCode(key));
      wait(howlong);
      KeyUp(GetKeyCode(key));
    end;

    No credit needed...
    To use it do this
    SCAR Code:
    HoldKey('n', 1000); // 'n' is the key you want to press, 1000 is how long you want it to hold it, in milliseconds
    ...I think they have established that already

  12. #12
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, I was just making a ready made procedure for him .

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hold Key
    By bmbm873 in forum OSR Help
    Replies: 1
    Last Post: 11-23-2008, 08:43 AM
  2. Hold Key Down
    By jeremywilms in forum OSR Help
    Replies: 4
    Last Post: 04-24-2007, 01:52 AM

Posting Permissions

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