Results 1 to 2 of 2

Thread: Wait for my key press?

  1. #1
    Join Date
    Jul 2008
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Wait for my key press?

    PROBLEM FIXED


    I made a TButton called "FindColorButton" and I want to make it so that when I click it, it waits for me to press a key on the keyboard, and when I press it it will get the color of whatever color my cursor is over. This is what I have-

    Code:
    Procedure FindColorProcedure (Sender: TObject);
    Begin
    
    End;
    Code:
    FindColorButton := TButton.Create(frmDesign); //FindColor
      FindColorButton.Parent := TabPages[2];
      FindColorButton.Left := 300;
      FindColorButton.Top := 100;
      FindColorButton.name :='FindColor';
      FindColorButton.Caption :='Find Color';
      FindColorButton.Width := 100;
      FindColorButton.OnClick := @FindColorProcedure;
    What do you think?

    EDIT:

    Instead I found the TColorPicker object and I think I can use that instead.
    Last edited by groog; 04-03-2009 at 10:29 PM.

  2. #2
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    just make it wait until if the key is down like...hmm i cannot remember the function.

    I think it's :
    PHP Code:
    KeyDown(KeyByte); 
    So you just choose a key, and make it so that if it doesn't at all get the keydown, then terminate the script or just make it repeat wait until the key is down.

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
  •