MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / Step

Method Step

Examples/StereoKitTest/Demos/DemoTextInput.cs:21–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 public void Shutdown () { }
20
21 public void Step()
22 {
23 UI.WindowBegin("Text Input", ref windowPose);
24
25 UI.Text("You can specify whether or not a UI element will hide an active soft keyboard upon interaction.");
26 UI.Button("Hides active soft keyboard");
27 UI.SameLine();
28 UI.PushPreserveKeyboard(true);
29 UI.Button("Doesn't hide");
30 UI.PopPreserveKeyboard();
31
32 UI.HSeparator();
33
34 UI.Text("Different TextContexts will surface different soft keyboards.");
35 Vec2 inputSize = V.XY(20*U.cm,0);
36 Vec2 labelSize = V.XY(8*U.cm,0);
37 UI.Label("Normal Text", labelSize); UI.SameLine(); UI.Input("TextText", ref text, inputSize, TextContext.Text);
38 UI.Label("URI Text", labelSize); UI.SameLine(); UI.Input("URIText", ref textUri, inputSize, TextContext.Uri);
39 UI.Label("Numeric Text", labelSize); UI.SameLine(); UI.Input("NumericText", ref number, inputSize, TextContext.Number);
40
41 UI.HSeparator();
42
43 UI.Text("Soft keyboards don't show up when a physical keyboard is known to be handy! Flatscreen apps and sessions where the user has pressed physical keys recently won't show any soft keyboards.");
44
45 bool forceKeyboard = Platform.ForceFallbackKeyboard;
46 if(UI.Toggle("Fallback Keyboard", ref forceKeyboard))
47 Platform.ForceFallbackKeyboard = forceKeyboard;
48
49 UI.SameLine();
50 bool openKeyboard = Platform.KeyboardVisible;
51 if (UI.Toggle("Show Keyboard", ref openKeyboard))
52 Platform.KeyboardShow(openKeyboard);
53
54 UI.WindowEnd();
55
56 Demo.ShowSummary(title, description, new Bounds(V.XY0(0, -0.19f), V.XYZ(.4f, .5f, 0)));
57 }
58}

Callers

nothing calls this directly

Calls 15

WindowBeginMethod · 0.80
TextMethod · 0.80
ButtonMethod · 0.80
SameLineMethod · 0.80
PushPreserveKeyboardMethod · 0.80
PopPreserveKeyboardMethod · 0.80
HSeparatorMethod · 0.80
LabelMethod · 0.80
InputMethod · 0.80
ToggleMethod · 0.80
KeyboardShowMethod · 0.80
WindowEndMethod · 0.80

Tested by

no test coverage detected