Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Hubs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ar-noc
Hubs
Commits
1602e9bd
Commit
1602e9bd
authored
6 years ago
by
johnshaughnessy
Browse files
Options
Downloads
Patches
Plain Diff
Rename buildMap to buildBindingsForSrcs
parent
16828c58
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/systems/userinput/userinput.js
+6
-6
6 additions, 6 deletions
src/systems/userinput/userinput.js
with
6 additions
and
6 deletions
src/systems/userinput/userinput.js
+
6
−
6
View file @
1602e9bd
...
@@ -25,7 +25,7 @@ import { resolveActionSets } from "./resolve-action-sets";
...
@@ -25,7 +25,7 @@ import { resolveActionSets } from "./resolve-action-sets";
import
{
GamepadDevice
}
from
"
./devices/gamepad
"
;
import
{
GamepadDevice
}
from
"
./devices/gamepad
"
;
import
{
gamepadBindings
}
from
"
./bindings/generic-gamepad
"
;
import
{
gamepadBindings
}
from
"
./bindings/generic-gamepad
"
;
function
build
Map
(
registeredMappings
)
{
function
build
BindingsForSrcs
(
registeredMappings
)
{
const
map
=
new
Map
();
const
map
=
new
Map
();
const
add
=
(
path
,
binding
)
=>
{
const
add
=
(
path
,
binding
)
=>
{
if
(
!
map
.
has
(
path
))
{
if
(
!
map
.
has
(
path
))
{
...
@@ -70,7 +70,7 @@ AFRAME.registerSystem("userinput", {
...
@@ -70,7 +70,7 @@ AFRAME.registerSystem("userinput", {
this
.
activeDevices
=
new
Set
([
new
MouseDevice
(),
new
AppAwareMouseDevice
(),
new
KeyboardDevice
(),
new
HudDevice
()]);
this
.
activeDevices
=
new
Set
([
new
MouseDevice
(),
new
AppAwareMouseDevice
(),
new
KeyboardDevice
(),
new
HudDevice
()]);
this
.
registeredMappings
=
new
Set
([
keyboardDebuggingBindings
]);
this
.
registeredMappings
=
new
Set
([
keyboardDebuggingBindings
]);
this
.
map
=
buildMap
(
this
.
registeredMappings
);
this
.
bindingsForSrc
=
buildBindingsForSrcs
(
this
.
registeredMappings
);
this
.
xformStates
=
new
Map
();
this
.
xformStates
=
new
Map
();
const
appAwareTouchscreenDevice
=
new
AppAwareTouchscreenDevice
();
const
appAwareTouchscreenDevice
=
new
AppAwareTouchscreenDevice
();
...
@@ -91,7 +91,7 @@ AFRAME.registerSystem("userinput", {
...
@@ -91,7 +91,7 @@ AFRAME.registerSystem("userinput", {
this
.
registeredMappings
.
add
(
keyboardMouseUserBindings
);
this
.
registeredMappings
.
add
(
keyboardMouseUserBindings
);
}
}
}
}
this
.
map
=
buildMap
(
this
.
registeredMappings
);
this
.
bindingsForSrc
=
buildBindingsForSrcs
(
this
.
registeredMappings
);
};
};
this
.
el
.
sceneEl
.
addEventListener
(
"
enter-vr
"
,
updateBindingsForVRMode
);
this
.
el
.
sceneEl
.
addEventListener
(
"
enter-vr
"
,
updateBindingsForVRMode
);
this
.
el
.
sceneEl
.
addEventListener
(
"
exit-vr
"
,
updateBindingsForVRMode
);
this
.
el
.
sceneEl
.
addEventListener
(
"
exit-vr
"
,
updateBindingsForVRMode
);
...
@@ -128,7 +128,7 @@ AFRAME.registerSystem("userinput", {
...
@@ -128,7 +128,7 @@ AFRAME.registerSystem("userinput", {
this
.
registeredMappings
.
add
(
gamepadBindings
);
this
.
registeredMappings
.
add
(
gamepadBindings
);
}
}
this
.
activeDevices
.
add
(
gamepadDevice
);
this
.
activeDevices
.
add
(
gamepadDevice
);
this
.
map
=
buildMap
(
this
.
registeredMappings
);
this
.
bindingsForSrc
=
buildBindingsForSrcs
(
this
.
registeredMappings
);
},
},
false
false
);
);
...
@@ -138,7 +138,7 @@ AFRAME.registerSystem("userinput", {
...
@@ -138,7 +138,7 @@ AFRAME.registerSystem("userinput", {
for
(
const
device
of
this
.
activeDevices
)
{
for
(
const
device
of
this
.
activeDevices
)
{
if
(
device
.
gamepad
===
e
.
gamepad
)
{
if
(
device
.
gamepad
===
e
.
gamepad
)
{
this
.
activeDevices
.
delete
(
device
);
this
.
activeDevices
.
delete
(
device
);
this
.
map
=
buildMap
(
this
.
registeredMappings
);
this
.
bindingsForSrc
=
buildBindingsForSrcs
(
this
.
registeredMappings
);
return
;
return
;
}
}
}
}
...
@@ -205,7 +205,7 @@ AFRAME.registerSystem("userinput", {
...
@@ -205,7 +205,7 @@ AFRAME.registerSystem("userinput", {
while
(
subpaths
.
length
>
1
)
{
while
(
subpaths
.
length
>
1
)
{
const
highestPriorityBindingForSubpath
=
maxAmongActive
(
const
highestPriorityBindingForSubpath
=
maxAmongActive
(
Array
.
join
(
subpaths
,
"
/
"
),
Array
.
join
(
subpaths
,
"
/
"
),
this
.
map
,
this
.
bindingsForSrc
,
this
.
activeSets
this
.
activeSets
);
);
if
((
binding
.
priority
||
0
)
<
highestPriorityBindingForSubpath
.
priority
)
{
if
((
binding
.
priority
||
0
)
<
highestPriorityBindingForSubpath
.
priority
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment