dcsimg
Results 1 to 2 of 2

Thread: Keyboard Testing

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,683

    Keyboard Testing

    Add the class to your project, create a button on your form and bung this code in... Run the program hold down the LEFT control key and click the button

    Code:
    private void button1_Click(object sender, System.EventArgs e)
    {
    	if(KeyTester.KeyIsDownNow(KeyTester.Key.LCONTROL))
    		MessageBox.Show("Left Control is pressed!");
    }
    Check out the KeyTester.Key enumeration to see all the available testable keys.

    There are two other methods in this class for testing if a key is not pressed or if a key is toggled.

    *Updated Again*, is now game quality
    Attached Files Attached Files
    Last edited by wossname; Sep 5th, 2005 at 12:09 PM.
    I don't live here any more.

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,191

    Re: Keyboard Testing

    And change it to this will maybe make it compile too...



    Code:
    private void button1_Click(object sender, System.EventArgs e)
    {
    	if(KeyTester.KeyIsDownNow(KeyTester.Key.LCONTROL))
    		MessageBox.Show("Left Control is pressed!");
    }

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width