Skip to content

Commit eb3dc5c

Browse files
committed
Document lovr.headset.stop/isActive;
1 parent f8fb069 commit eb3dc5c

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

api/init.lua

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26179,6 +26179,30 @@ return {
2617926179
}
2618026180
}
2618126181
},
26182+
{
26183+
name = "isActive",
26184+
tag = "headset-misc",
26185+
summary = "Check if the headset session is active.",
26186+
description = "Returns whether a headset session is active. When true, there is an active connection to the VR hardware. When false, most headset methods will not work properly until `lovr.headset.start` is used to start a session.",
26187+
key = "lovr.headset.isActive",
26188+
module = "lovr.headset",
26189+
related = {
26190+
"lovr.headset.start",
26191+
"lovr.headset.stop"
26192+
},
26193+
variants = {
26194+
{
26195+
arguments = {},
26196+
returns = {
26197+
{
26198+
name = "active",
26199+
type = "boolean",
26200+
description = "Whether the headset session is active."
26201+
}
26202+
}
26203+
}
26204+
}
26205+
},
2618226206
{
2618326207
name = "isDown",
2618426208
tag = "input",
@@ -26749,6 +26773,25 @@ return {
2674926773
}
2675026774
}
2675126775
},
26776+
{
26777+
name = "stop",
26778+
tag = "headset-misc",
26779+
summary = "Stop the headset session.",
26780+
description = "Stops the headset session. This tears down the connection to the VR runtime and hardware. `lovr.draw` will instead start rendering to the desktop window, as though the headset module was disabled. However, certain information about the headset can still be queried, such as its name, supported passthrough modes, display size, etc. A headset session can be started later using `lovr.headset.start`.",
26781+
key = "lovr.headset.stop",
26782+
module = "lovr.headset",
26783+
notes = "The headset module behaves in the following manner when there is no headset session:\n\n- `lovr.headset.isActive` returns `false`.\n- `lovr.headset.getPass` returns `nil`.\n- All devices will be untracked.",
26784+
related = {
26785+
"lovr.headset.start",
26786+
"lovr.headset.isActive"
26787+
},
26788+
variants = {
26789+
{
26790+
arguments = {},
26791+
returns = {}
26792+
}
26793+
}
26794+
},
2675226795
{
2675326796
name = "stopVibration",
2675426797
tag = "input",

api/lovr/headset/isActive.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
return {
2+
tag = 'headset-misc',
3+
summary = 'Check if the headset session is active.',
4+
description = [[
5+
Returns whether a headset session is active. When true, there is an active connection to the VR
6+
hardware. When false, most headset methods will not work properly until `lovr.headset.start` is
7+
used to start a session.
8+
]],
9+
arguments = {},
10+
returns = {
11+
active = {
12+
type = 'boolean',
13+
description = 'Whether the headset session is active.'
14+
}
15+
},
16+
variants = {
17+
{
18+
arguments = {},
19+
returns = { 'active' }
20+
}
21+
},
22+
related = {
23+
'lovr.headset.start',
24+
'lovr.headset.stop'
25+
}
26+
}

0 commit comments

Comments
 (0)