Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions streamerbot/3.api/3.csharp/_methods/core/system/KeyboardPress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
description: Simulate a keyboard input
parameters:
- name: keyPress
type: string
required: true
description: |
The keystroke to send.
example: |
using System;

public class CPHInline
{
public bool Execute()
{
// The CPH method uses the SendKeys method. That means the keyPress string needs to be enclosed in curly brackets {}. To use key combinations (SHIFT, CTRL and ALT) you can use code modifiers listed in the link or the examples below.

// https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys.send

// Note: The key list in the link above is exhaustive. If a key isn't listed there, then it's not available for this method.

// Examples:

// 'W'
CPH.KeyboardPress("{W}");

// 'DOWN ARROW'
CPH.KeyboardPress("{DOWN}");

// 'SHIFT' and 'W'
CPH.KeyboardPress("+{W}");

// 'CTRL' and 'W'
CPH.KeyboardPress("^{W}");

// 'ALT' and 'W'
CPH.KeyboardPress("%{W}");

return true;
}
}
---
Loading