Share via


KeyboardState.IsKeyDown Method

Returns whether a specified key is currently being pressed.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public bool IsKeyDown (
         Keys key
)

Parameters

  • key
    Enumerated value that specifies the key to query.

Return Value

true if the key specified by key is being held down; false otherwise.

See Also

Tasks

How to: Detect Whether a Key Is Pressed

Concepts

Input Overview

Reference

KeyboardState Structure
KeyboardState Members
Microsoft.Xna.Framework.Input Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista