Rearrange files again, and fix more bugs
This commit is contained in:
parent
b0329fd8ce
commit
d57905c731
|
@ -70,16 +70,18 @@ function touch(e) {
|
|||
click_timeout = setTimeout(function() {
|
||||
is_short = false
|
||||
}, 1000)
|
||||
is_short = true
|
||||
}
|
||||
|
||||
|
||||
function release(e) {
|
||||
clearTimeout(click_timeout)
|
||||
x = e.layerX
|
||||
y = e.layerY
|
||||
w = displayWidth
|
||||
length = is_short?0:1
|
||||
length = is_short?false:true
|
||||
ws.send('touch ' + localStorage.getItem('password') + ' ' + x + ' ' + y + ' ' + w + ' ' + length)
|
||||
clearTimeout(click_timeout)
|
||||
is_short = true
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import os
|
||||
import base64
|
||||
import hcapi
|
||||
import threading
|
||||
import logging
|
||||
import random
|
||||
|
@ -10,11 +9,19 @@ import tempfile
|
|||
import queue
|
||||
from websocket_server import WebsocketServer
|
||||
|
||||
|
||||
# Select backend - backends.port8080 uses HamClock's port 8080 service;
|
||||
# backends.x11 uses an X11 server (typically Xvfb) (make sure DISPLAY is set
|
||||
# correctly!)
|
||||
|
||||
#import backends.port8080 as hcapi
|
||||
import backends.x11 as hcapi
|
||||
|
||||
|
||||
def cycle():
|
||||
try:
|
||||
changed = hcapi.get_img()
|
||||
except Exception as e:
|
||||
#server.send_message_to_all('err%noconn%Server failed to capture screenshot')
|
||||
for client in clients.values():
|
||||
client.send('err%noconn%Server failed to capture screenshot', 'ERR')
|
||||
time.sleep(3)
|
||||
|
@ -109,7 +116,7 @@ def do_touch(client, server, message):
|
|||
else:
|
||||
_, password, x, y, w, is_long = message.split(' ')
|
||||
if password == 'password':
|
||||
x, y, w, is_long = int(x), int(y), int(w), bool(is_long)
|
||||
x, y, w, is_long = int(x), int(y), int(w), is_long == 'true'
|
||||
hcapi.touch(x, y, w, is_long)
|
||||
else:
|
||||
clients[client['id']].send(f'badpass', 'BADPASS')
|
||||
|
|
Loading…
Reference in New Issue
Block a user