3 Replies - 5253 Views - Last Post: 23 June 2008 - 09:35 AM Rate Topic: -----

#1 HeadShot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 01-June 08

XNA User Input

Post icon  Posted 22 June 2008 - 09:14 PM

I'm using XNA 2.0 Game Studio, and I can't figure out how to get user input from Mouse and keyboard. I don't really care about Xbox 360 input, as I'm going to be mostly working with Computer games. Can anyone find me/write a tutorials for me about how to do this please? Thanks for the Help.
Is This A Good Question/Topic? 0
  • +

Replies To: XNA User Input

#2 Antiokus  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 192
  • Joined: 06-September 06

Re: XNA User Input

Posted 22 June 2008 - 11:12 PM

The best resource I've found for most dev with XNA is XNA's creator site:
http://www.creators.xna.com/

They have tutorials and walk throughs for almost anything.
Also (I'm assuming you are using VS C#) you can go to [Menu] -> Help -> Content

There is an XNA tab in there with a lot of beginner info.
Was This Post Helpful? 0
  • +
  • -

#3 RodgerB  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 66
  • View blog
  • Posts: 2,284
  • Joined: 21-September 07

Re: XNA User Input

Posted 23 June 2008 - 03:34 AM

In your Update event, call the Keyboard.GetState().IsKeyDown() method to check if a key has been pressed. Example:

if(Keyboard.GetState().IsKeyDown(Keys.Escape))
{
    // hac into da world yo.
}



Hope that helps. :)

This post has been edited by RodgerB: 23 June 2008 - 03:34 AM

Was This Post Helpful? 0
  • +
  • -

#4 HeadShot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 01-June 08

Re: XNA User Input

Posted 23 June 2008 - 09:35 AM

Ok, Thanks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1