mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-08 06:28:29 +01:00
RemoteDesktop: sync clipboard between local and remote
This commit is contained in:
parent
a4943e83d1
commit
f3a8f17ef1
@ -7,6 +7,7 @@ Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blo
|
||||
|
||||
|
||||
## Change logs
|
||||
* v0.1.10 - Allow to sync clipboard between local and remote machine, CTRL+SHIF+V to paste text from local to remote machine
|
||||
* v0.1.9 - improve stability
|
||||
* v0.1.7-8 - remove package dependencies, use web assembly for jpeg decoding, improve rendering performance and connection stability
|
||||
* v0.1.6 - Change category
|
||||
|
@ -7,6 +7,7 @@ Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blo
|
||||
|
||||
|
||||
## Change logs
|
||||
* v0.1.10 - Allow to sync clipboard between local and remote machine, CTRL+SHIF+V to paste text from local to remote machine
|
||||
* v0.1.9 - improve stability
|
||||
* v0.1.7-8 - remove package dependencies, use web assembly for jpeg decoding, improve rendering performance and connection stability
|
||||
* v0.1.6 - Change category
|
||||
|
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@
|
||||
"author": "Dany LE",
|
||||
"email": "contact@iohub.dev"
|
||||
},
|
||||
"version":"0.1.9-b",
|
||||
"version":"0.1.10-b",
|
||||
"dependencies": [],
|
||||
"category":"Internet",
|
||||
"icon": "icon.png",
|
||||
|
Binary file not shown.
@ -262,8 +262,13 @@ class WVNC
|
||||
|
||||
sendTextAsClipboard: (text) ->
|
||||
return unless @socket
|
||||
console.log "send ", text
|
||||
@socket.send (@buildCommand 0x07, text)
|
||||
# send ctrl-v to paste
|
||||
charcode = 'v'.charCodeAt 0
|
||||
@sendKeyEvent 0xFFE3, 1 # CTRL down
|
||||
@sendKeyEvent charcode, 1 # v down
|
||||
@sendKeyEvent charcode, 0 # v up
|
||||
@sendKeyEvent 0xFFE3, 0 # CTRL up
|
||||
|
||||
oncredential: () ->
|
||||
return new Promise (resolve, reject) ->
|
||||
|
@ -88,6 +88,8 @@ class RemoteDesktop extends this.OS.application.BaseApplication
|
||||
@client = new WVNC {
|
||||
element: @canvas
|
||||
}
|
||||
@bindKey "CTRL-SHIFT-V", (e) =>
|
||||
@pasteText()
|
||||
@client.onerror = (m) =>
|
||||
@error m
|
||||
@showConnectionDialog()
|
||||
@ -103,7 +105,9 @@ class RemoteDesktop extends this.OS.application.BaseApplication
|
||||
}
|
||||
.then (d) ->
|
||||
r(d)
|
||||
|
||||
@client.oncopy = (text) =>
|
||||
@_api.setClipboard text
|
||||
|
||||
@client.oncredential = () =>
|
||||
return new Promise (r,e) =>
|
||||
@openDialog new CredentialDialog, { title: __("User credential") }
|
||||
@ -114,6 +118,23 @@ class RemoteDesktop extends this.OS.application.BaseApplication
|
||||
@client.init().then () =>
|
||||
@showConnectionDialog()
|
||||
|
||||
pasteText: () ->
|
||||
return unless @client
|
||||
cb = (text) =>
|
||||
return unless text and text isnt ""
|
||||
@client.sendTextAsClipboard text
|
||||
|
||||
@_api.getClipboard()
|
||||
.then (text) =>
|
||||
cb(text)
|
||||
.catch (e) =>
|
||||
@error __("Unable to paste"), e
|
||||
#ask for user to enter the text manually
|
||||
@openDialog("TextDialog", { title: "Paste text"})
|
||||
.then (text) =>
|
||||
cb(text)
|
||||
.catch (err) => @error err.toString(), err
|
||||
|
||||
setScale: () ->
|
||||
return unless @client and @client.resolution
|
||||
w = $(@container).width()
|
||||
|
@ -7,7 +7,7 @@
|
||||
"author": "Dany LE",
|
||||
"email": "contact@iohub.dev"
|
||||
},
|
||||
"version":"0.1.9-b",
|
||||
"version":"0.1.10-b",
|
||||
"dependencies": [],
|
||||
"category":"Internet",
|
||||
"icon": "icon.png",
|
||||
|
@ -365,7 +365,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/RemoteDesktop/README.md",
|
||||
"category": "Internet",
|
||||
"author": "Dany LE",
|
||||
"version": "0.1.9-b",
|
||||
"version": "0.1.10-b",
|
||||
"dependencies": [],"category":"Internet","icon":"icon.png","mimes":["none"],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/RemoteDesktop/build/release/RemoteDesktop.zip"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user