Skip to content

Commit ec6f3eb

Browse files
committed
- remove personal modification
- add touch handler
1 parent 6d0604d commit ec6f3eb

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

app/src/main/java/vn/vhn/vhscode/CodeServerService.kt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,26 @@ class CodeServerService : Service() {
168168
val stream = FileInputStream(configFile)
169169
val data = stream.readBytes()
170170
stream.close()
171-
return String(data)
171+
return """
172+
(function(){
173+
let click = false;
174+
let click2 = false;
175+
const clickTimer = function(){
176+
click=true;click2=true;
177+
setTimeout(()=>{click=false;},300)
178+
};
179+
document.body.addEventListener('click', ()=>{click2=false;});
180+
document.body.addEventListener('touchstart', clickTimer);
181+
document.body.addEventListener('touchmove', ()=>{click=false;});
182+
document.body.addEventListener('touchend', (e)=>{
183+
if(click) {
184+
setTimeout(()=>{
185+
if(click2) e.target.click();
186+
},100);
187+
}
188+
});
189+
})()
190+
""".trimIndent() + String(data)
172191
}
173192
}
174193

app/src/main/res/raw/vsboot.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,4 @@
3131
return this._vscodeCode;
3232
}
3333
});
34-
Object.defineProperty(KeyboardEvent.prototype, 'altKey', {
35-
get(){
36-
prepareCustomProps.apply(this);
37-
return false;
38-
}
39-
});
4034
})()

0 commit comments

Comments
 (0)