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); +} +```