From 40f07ec30fa5b52100e01c918a567b11a1826e43 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 26 Mar 2021 17:54:09 -0700 Subject: [PATCH] document a few more features --- content/Input/_index.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/content/Input/_index.md b/content/Input/_index.md index 78b2548..710b7cc 100644 --- a/content/Input/_index.md +++ b/content/Input/_index.md @@ -57,6 +57,12 @@ var mouseX = Inputs.Mouse.X; var deltaMouseY = Inputs.Mouse.DeltaY; ``` +You can also read scroll wheel movement. Negative values are down-scrolls, positive values are up-scrolls. + +```cs +var wheel = Inputs.Mouse.Wheel; +``` + `RelativeMode` hides the mouse and does not update the position of the mouse while still returning movement deltas. This is ideal for creating FPS-style controls. To enable it, simply do: @@ -98,3 +104,15 @@ var rightMotorAmount = 0.5; var durationInMilliseconds = 10; gamepad.SetVibration(leftMotorAmount, rightMotorAmount, durationInMilliseconds) ``` + +## Text Input + +Sometimes you might want to do something like divert keyboard inputs into a text box. +`Inputs` provides a `TextInput` callback that you can hook into for this purpose. + +```cs +Inputs.TextInput += c => +{ + ImGui.GetIO().AddInputCharacter(c); +} +```