From 6dedb51c835b5ab2559755fe4648f5ecd1f4a536 Mon Sep 17 00:00:00 2001 From: jjlustig <jjlustig@umich.edu> Date: Tue, 20 Feb 2018 13:09:29 -0500 Subject: [PATCH] Adding space, enter, del --- configuration.json | 16 +++++++++++++--- public/client.html | 4 ++-- public/js/client.js | 2 +- public/style/main.css | 2 ++ public/style/style.js | 2 +- server.js | 14 +++++++++++++- 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/configuration.json b/configuration.json index 37d0084..f9820f3 100644 --- a/configuration.json +++ b/configuration.json @@ -35,7 +35,7 @@ "0" ], "button8": [ - "i", + "W", "70", "0" ], @@ -129,9 +129,19 @@ "60", "60" ], - "button0": [ - " ", + "button27": [ + "#", "70", "60" + ], + "button28": [ + "@", + "80", + "60" + ], + "button29": [ + "*", + "90", + "60" ] } \ No newline at end of file diff --git a/public/client.html b/public/client.html index 2427bf1..56f7f07 100755 --- a/public/client.html +++ b/public/client.html @@ -58,10 +58,10 @@ </div> </header> <div class="wrapper"> - <div class = "keyboard" id="keyboard"> - </div> <div class="touchpad" id="touchpad"> </div> + <div class = "keyboard" id="keyboard"> + </div> </div> <!-- The Modal --> diff --git a/public/js/client.js b/public/js/client.js index eaeb4c7..ec2c698 100755 --- a/public/js/client.js +++ b/public/js/client.js @@ -11,7 +11,7 @@ var modal = document.getElementById('myModal');// Modal textbox var inputModal = document.getElementById('inputText'); var keyboardWidth = document.getElementById('keyboard').offsetWidth;// Width pixel of display var keyboardHeight = document.getElementById('keyboard').offsetHeight;// Height pixel of -$("#touchpad").hide(); +//$("#touchpad").hide(); /* -----------KEYBOARD CONTROLS--------------- diff --git a/public/style/main.css b/public/style/main.css index 390bf13..21c98fc 100755 --- a/public/style/main.css +++ b/public/style/main.css @@ -28,6 +28,8 @@ body { margin-top: 3%; border-radius: 2em; padding: 4%; + font-size: 19px; + text-align: center; /*Button Coloring*/ diff --git a/public/style/style.js b/public/style/style.js index 120ca81..70e7b45 100644 --- a/public/style/style.js +++ b/public/style/style.js @@ -3,7 +3,7 @@ document.body.onload = addKeyboard; function addKeyboard () { - var keys = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']; + var keys = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','#','@','*']; for (var i = 0; i < keys.length; i++) { // create a new div element diff --git a/server.js b/server.js index 5949d98..ed27b0e 100755 --- a/server.js +++ b/server.js @@ -78,7 +78,19 @@ io.on('connection', function(socket) { socket.emit('updateKeys', {k: keys, x: xpos, y: ypos}); socket.on('string', function(str) { console.log("Trying to type") - robot.typeString(str) + console.log(str); + if (str === "@"){ + robot.keyTap('enter'); + } + else if (str === "#"){ + robot.keyTap('space'); + } + else if (str === '*'){ + robot.keyTap('backspace'); + } + else{ + robot.typeString(str) + } }); socket.on('saveKey', function(key) { -- GitLab