diff --git a/src/core/routes/Routes.py b/src/core/routes/Routes.py
index a73e233..e0fe225 100644
--- a/src/core/routes/Routes.py
+++ b/src/core/routes/Routes.py
@@ -43,14 +43,12 @@ def updateCoords2(x, y):
message='Key is not a valid input...')
-@app.route('/send-key', methods=['GET', 'POST'])
-def sendKey():
- pyautogui.doubleClick()
+@app.route('/send-keys', methods=['GET', 'POST'])
+def sendKeys():
if request.method == 'POST':
try:
text = str(request.values['text']).strip()
pyautogui.typewrite(text);
-
# print("\nX: {} Y: {}".format(str(x), str(y)))
# pyautogui.typewrite('Hello world!\n', interval=secs_between_keys) # useful for entering text, newline is Enter
# pyautogui.press(['left', 'left', 'left', 'left']) # Press the left arrow key 4 times.
diff --git a/src/core/routes/Sockets.py b/src/core/routes/Sockets.py
index 32d0931..595a252 100644
--- a/src/core/routes/Sockets.py
+++ b/src/core/routes/Sockets.py
@@ -57,6 +57,12 @@ def scrollDown(eve = None):
pyautogui.scroll(-1)
return ""
+@app.route('/press-enter')
+@socketio.on('press_enter')
+def pressEnter(eve = None):
+ pyautogui.press("enter")
+ return ""
+
@socketio.on('update_coords')
def updateCoords(message):
diff --git a/src/core/static/css/main.css b/src/core/static/css/main.css
index ba1a6b5..b98b752 100644
--- a/src/core/static/css/main.css
+++ b/src/core/static/css/main.css
@@ -63,9 +63,10 @@ input {
cursor: pointer;
}
+#sendKeysBtn,
+#pressEnterBtn,
#scrollToggle,
-#mouseHoldToggle,
-#sendKeysBtn {
+#mouseHoldToggle {
display: inline-block;
font-size: 280%;
width: 100%;
diff --git a/src/core/static/js/events.js b/src/core/static/js/events.js
index 32842ad..7fff859 100644
--- a/src/core/static/js/events.js
+++ b/src/core/static/js/events.js
@@ -114,6 +114,15 @@ function rightClick() {
socket.emit('right_click', "");
}
+function sendKeys() {
+ const text = document.getElementById("sendKeysField").value.trim();
+ doAjax("/send-keys", "text=" + text, "send-keys");
+}
+
+function pressEnter() {
+ socket.emit('press_enter', "");
+}
+
function scrollToggle() {
if (isScrolling) {
isScrolling = false;
@@ -160,6 +169,8 @@ document.addEventListener("touchend", touchHandler, true);
document.addEventListener("touchcancel", touchHandler, true);
document.getElementById("rightClickBtn").addEventListener("mouseup", rightClick, true);
+document.getElementById("sendKeysBtn").addEventListener("mouseup", sendKeys, true);
+document.getElementById("pressEnterBtn").addEventListener("mouseup", pressEnter, true);
document.getElementById("scrollToggle").addEventListener("mouseup", scrollToggle, true);
document.getElementById("mouseHoldToggle").addEventListener("mouseup", holdToggle, true);
diff --git a/src/core/static/js/main.css b/src/core/static/js/main.css
new file mode 100644
index 0000000..b98b752
--- /dev/null
+++ b/src/core/static/js/main.css
@@ -0,0 +1,99 @@
+/* Elms */
+ul, li {
+ list-style: none;
+}
+
+body {
+ touch-action: manipulation;
+ overflow: hidden; /* Used to prevent touch scroll down reloading page. Ref: https://stackoverflow.com/questions/29008194/disabling-androids-chrome-pull-down-to-refresh-feature */
+ -webkit-touch-callout: none; /* iOS Safari */
+ -webkit-user-select: none; /* Safari */
+ -khtml-user-select: none; /* Konqueror HTML */
+ -moz-user-select: none; /* Old versions of Firefox */
+ -ms-user-select: none; /* Internet Explorer/Edge */
+ user-select: none; /* Non-prefixed version, currently
+ supported by Chrome, Opera and Firefox */
+}
+
+input {
+ width: 100% !important;
+ margin: 0 auto !important;
+ background-color: #00000000 !important;
+}
+
+
+/* IDs */
+#bg {
+ position: fixed;
+ top: 0%;
+ left: 0%;
+ width: 100%;
+ height: 100%;
+ z-index: -999;
+}
+
+#bg img {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ width: 100%;
+ height: 100%;
+ z-index: -999;
+}
+
+#canvas {
+ position: relative;
+ width: 98%;
+ min-height: 1000px;
+ border: 2px solid #c3c3c3;
+}
+
+#rightClickBtn {
+ display: none; /* Hide button unless screen bigger than media query says it is */
+ border-style: dashed;
+ border-width: 2px;
+ overflow: auto;
+ font-size: 280%;
+}
+
+#rightClickBtn:hover {
+ background-color: rgba(0, 232, 255, 0.5);
+ cursor: pointer;
+}
+
+#sendKeysBtn,
+#pressEnterBtn,
+#scrollToggle,
+#mouseHoldToggle {
+ display: inline-block;
+ font-size: 280%;
+ width: 100%;
+}
+
+
+@media only screen and (max-device-width: 800px) {
+ #sendKeysField {
+ font-size: 300% !important;
+ }
+}
+
+/* nothing with screen size smaller than 8000px */
+@media only screen and (min-device-width: 801px) {
+ body {
+ width: 800px;
+ margin: 0 auto;
+ }
+
+ #rightClickBtn {
+ display: inline-block;
+ }
+}
+
+
+/* Classes */
+/* Other message text colors */
+.errorTxt { color: rgb(170, 18, 18); }
+.warningTxt { color: rgb(255, 168, 0); }
+.successTxt { color: rgb(136, 204, 39); }
diff --git a/src/core/templates/index.html b/src/core/templates/index.html
index c1e510c..10f1750 100644
--- a/src/core/templates/index.html
+++ b/src/core/templates/index.html
@@ -15,8 +15,15 @@