Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EECS498-uBoard
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jjlustig
EECS498-uBoard
Commits
3d5788e7
Commit
3d5788e7
authored
7 years ago
by
Laurel Williams
Browse files
Options
Downloads
Patches
Plain Diff
Fix space key for Apple keyboards
parent
2ff1a8b4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
public/js/client.js
+4
-0
4 additions, 0 deletions
public/js/client.js
server.js
+3
-3
3 additions, 3 deletions
server.js
with
7 additions
and
3 deletions
public/js/client.js
+
4
−
0
View file @
3d5788e7
...
...
@@ -131,6 +131,10 @@ $( "#textfield" ).keydown(function(event) {
else
if
(
event
.
key
.
startsWith
(
'
Arrow
'
)
&&
document
.
getElementById
(
'
textfield
'
).
value
===
""
)
{
// arrow keys
socket
.
emit
(
'
functionality
'
,
event
.
key
);
}
else
if
(
event
.
keyCode
===
32
&&
document
.
getElementById
(
'
textfield
'
).
value
===
''
)
{
// space
socket
.
emit
(
'
functionality
'
,
'
Space
'
);
document
.
getElementById
(
'
textfield
'
).
value
=
''
;
}
});
//Purpose: Uses interact.js library to enable keys to move around
...
...
This diff is collapsed.
Click to expand it.
server.js
+
3
−
3
View file @
3d5788e7
...
...
@@ -148,14 +148,14 @@ io.on('connection', function(socket) {
case
'
ArrowRight
'
:
robot
.
keyTap
(
'
right
'
);
break
;
case
'
Space
'
:
robot
.
keyTap
(
'
space
'
);
break
;
}
});
socket
.
on
(
'
text
'
,
function
(
text
)
{
console
.
log
(
'
Typing
'
+
text
);
if
(
text
===
'
'
)
{
robot
.
keyTap
(
'
space
'
);
}
robot
.
typeString
(
text
);
});
...
...
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