Skip to content

Need Help With Checking If Key Is Pressed Down #47

@aimoistkun

Description

@aimoistkun

How do I do this? I would like to check if a key is pressed down?
The function on the main page does not work. Anyone know how I can check? Thanks.

`public void GetKeyStatus()
{
// Determines if the shift key is currently down
var isShiftKeyDown = InputSimulator.IsKeyDown(VirtualKeyCode.SHIFT);

// Determines if the caps lock key is currently in effect (toggled on)
var isCapsLockOn = InputSimulator.IsTogglingKeyInEffect(VirtualKeyCode.CAPITAL);
}`

The Code That I Have So Far Is

var sim = new InputSimulator(); sim.Keyboard.KeyDown(VirtualKeyCode.VK_5);

I need a code to check if "5" is pressed down.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions