@antha/input 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -29,6 +29,8 @@ export type AnthaReadRawInputModState = {
|
|
|
29
29
|
deviceHandler: Pick<InputDeviceHandler, 'readAllDevices'>;
|
|
30
30
|
rawInputs: RawInputs;
|
|
31
31
|
currentInputDevices: SimpleInputDevicesMap;
|
|
32
|
+
/** If true, the mod doesn't read raw inputs. */
|
|
33
|
+
disableInputs: boolean;
|
|
32
34
|
/**
|
|
33
35
|
* If no model map is provided, the built-in defaults from
|
|
34
36
|
* [gamepad-type](https://www.npmjs.com/package/gamepad-type) are used. If a model map is
|
|
@@ -26,11 +26,17 @@ export function createAnthaReadRawInputMod(options = {}) {
|
|
|
26
26
|
startLoopImmediately: false,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
if (state.disableInputs) {
|
|
30
|
+
state.rawInputs = {};
|
|
31
|
+
state.currentInputDevices = {};
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const { currentDevices, rawInputs } = readRawInputs(state, {
|
|
35
|
+
msSinceLastExecute,
|
|
36
|
+
});
|
|
37
|
+
state.rawInputs = rawInputs;
|
|
38
|
+
state.currentInputDevices = currentDevices;
|
|
39
|
+
}
|
|
34
40
|
if (state.debugRawInputs) {
|
|
35
41
|
return html `
|
|
36
42
|
<${AnthaRawInputDebug.assign({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antha/input",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "An Antha mod for handling inputs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vir",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"test:docs": "virmator docs check"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@antha/gamepad-type": "^0.
|
|
36
|
+
"@antha/gamepad-type": "^0.6.0",
|
|
37
37
|
"@augment-vir/assert": "^32.2.3",
|
|
38
38
|
"@augment-vir/common": "^32.2.3",
|
|
39
39
|
"date-vir": "^9.1.1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"istanbul-smart-text-reporter": "^1.1.5"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@antha/engine": "^0.
|
|
54
|
+
"@antha/engine": "^0.6.0",
|
|
55
55
|
"element-vir": ">=26"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|