RemoteDesktop: v0.1.16 - Allow to enable/disable mouse capture in remote desktop, remove some unused toolbar buttons

This commit is contained in:
DanyLE 2023-01-08 00:21:02 +01:00
parent b3db4861ef
commit a2a602f5b2
13 changed files with 24 additions and 22 deletions

View File

@ -7,6 +7,7 @@ Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blo
## Change logs ## Change logs
* v0.1.16 - Allow to enable/disable mouse capture in remote desktop, remove some unused toolbar buttons
* v0.1.15 - Only send ACK command when finish rendering the received frame, this allows to vastly improve performance and bandwidth * v0.1.15 - Only send ACK command when finish rendering the received frame, this allows to vastly improve performance and bandwidth
* v0.1.14 - Add toolbar for canvas size control * v0.1.14 - Add toolbar for canvas size control
* v0.1.13 - support AntOS v2.0.x * v0.1.13 - support AntOS v2.0.x

View File

@ -1,7 +1,7 @@
afx-app-window[data-id="RemoteDesktop"] div[data-id="container"] afx-app-window[data-id="RemoteDesktop"] div[data-id="container"]
{ {
background-color: #272822; background-color: #272822;
overflow: hidden; overflow: auto;
} }
afx-app-window[data-id="RemoteDesktop"] canvas[data-id="screen"] afx-app-window[data-id="RemoteDesktop"] canvas[data-id="screen"]
{ {

View File

@ -8,10 +8,9 @@
<div data-width = "5" ></div> <div data-width = "5" ></div>
<afx-slider data-id="zoom" ></afx-slider> <afx-slider data-id="zoom" ></afx-slider>
<div data-width = "5" ></div> <div data-width = "5" ></div>
<afx-button iconclass="bi bi-box-arrow-down" data-id="scroll_down" data-width="content"></afx-button> <afx-switch data-id="capture_mouse" swon="true" data-width="content" style="line-height:35px;"></afx-switch>
<afx-button iconclass="bi bi-box-arrow-up" data-id="scroll_up" data-width="content"></afx-button> <afx-label text="__(Mouse capture)" data-width="content" style="line-height:35px;"></afx-label>
<afx-button iconclass="bi bi-box-arrow-left" data-id="scroll_left" data-width="content"></afx-button> <div data-width = "2" ></div>
<afx-button iconclass="bi bi-box-arrow-right" data-id="scroll_right" data-width="content"></afx-button>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window> </afx-app-window>

View File

@ -7,6 +7,7 @@ Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blo
## Change logs ## Change logs
* v0.1.16 - Allow to enable/disable mouse capture in remote desktop, remove some unused toolbar buttons
* v0.1.15 - Only send ACK command when finish rendering the received frame, this allows to vastly improve performance and bandwidth * v0.1.15 - Only send ACK command when finish rendering the received frame, this allows to vastly improve performance and bandwidth
* v0.1.14 - Add toolbar for canvas size control * v0.1.14 - Add toolbar for canvas size control
* v0.1.13 - support AntOS v2.0.x * v0.1.13 - support AntOS v2.0.x

View File

@ -1,7 +1,7 @@
afx-app-window[data-id="RemoteDesktop"] div[data-id="container"] afx-app-window[data-id="RemoteDesktop"] div[data-id="container"]
{ {
background-color: #272822; background-color: #272822;
overflow: hidden; overflow: auto;
} }
afx-app-window[data-id="RemoteDesktop"] canvas[data-id="screen"] afx-app-window[data-id="RemoteDesktop"] canvas[data-id="screen"]
{ {

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
"author": "Dany LE", "author": "Dany LE",
"email": "contact@iohub.dev" "email": "contact@iohub.dev"
}, },
"version":"0.1.15-b", "version":"0.1.16-b",
"dependencies": [], "dependencies": [],
"category":"Internet", "category":"Internet",
"icon": "icon.png", "icon": "icon.png",

View File

@ -8,10 +8,9 @@
<div data-width = "5" ></div> <div data-width = "5" ></div>
<afx-slider data-id="zoom" ></afx-slider> <afx-slider data-id="zoom" ></afx-slider>
<div data-width = "5" ></div> <div data-width = "5" ></div>
<afx-button iconclass="bi bi-box-arrow-down" data-id="scroll_down" data-width="content"></afx-button> <afx-switch data-id="capture_mouse" swon="true" data-width="content" style="line-height:35px;"></afx-switch>
<afx-button iconclass="bi bi-box-arrow-up" data-id="scroll_up" data-width="content"></afx-button> <afx-label text="__(Mouse capture)" data-width="content" style="line-height:35px;"></afx-label>
<afx-button iconclass="bi bi-box-arrow-left" data-id="scroll_left" data-width="content"></afx-button> <div data-width = "2" ></div>
<afx-button iconclass="bi bi-box-arrow-right" data-id="scroll_right" data-width="content"></afx-button>
</afx-hbox> </afx-hbox>
</afx-vbox> </afx-vbox>
</afx-app-window> </afx-app-window>

View File

@ -10,6 +10,7 @@ class WVNC
@canvas = document.getElementById @canvas if typeof @canvas is 'string' @canvas = document.getElementById @canvas if typeof @canvas is 'string'
@decoder = new Worker worker @decoder = new Worker worker
@enableEvent = false @enableEvent = false
@mouseCapture = true
@pingto = false @pingto = false
me = @ me = @
@mouseMask = 0 @mouseMask = 0
@ -47,15 +48,18 @@ class WVNC
return false return false
me.canvas.onmousemove = (e) -> me.canvas.onmousemove = (e) ->
return unless me.mouseCapture
sendMouseLocation e sendMouseLocation e
me.canvas.onmousedown = (e) -> me.canvas.onmousedown = (e) ->
return unless me.mouseCapture
state = 1 << e.button state = 1 << e.button
me.mouseMask = me.mouseMask | state me.mouseMask = me.mouseMask | state
sendMouseLocation e sendMouseLocation e
#e.preventDefault() #e.preventDefault()
me.canvas.onmouseup = (e) -> me.canvas.onmouseup = (e) ->
return unless me.mouseCapture
state = 1 << e.button state = 1 << e.button
me.mouseMask = me.mouseMask & (~state) me.mouseMask = me.mouseMask & (~state)
sendMouseLocation e sendMouseLocation e
@ -109,6 +113,7 @@ class WVNC
# mouse wheel event # mouse wheel event
@canvas.addEventListener 'wheel', (e) -> @canvas.addEventListener 'wheel', (e) ->
return unless me.enableEvent return unless me.enableEvent
return unless me.mouseCapture
#if (e.deltaY < 0) # up #if (e.deltaY < 0) # up
p = getMousePos e p = getMousePos e
e.preventDefault() e.preventDefault()

View File

@ -34,6 +34,7 @@ ConnectionDialog.scheme = """
<div data-height="5"></div> <div data-height="5"></div>
<afx-label text="__(JPEG quality)" data-height="30" class="header" ></afx-label> <afx-label text="__(JPEG quality)" data-height="30" class="header" ></afx-label>
<afx-slider data-id ="jq" data-height="30" ></afx-slider> <afx-slider data-id ="jq" data-height="30" ></afx-slider>
<div></div>
<afx-hbox data-height = '35'> <afx-hbox data-height = '35'>
<div style=' text-align:right;'> <div style=' text-align:right;'>
<afx-button data-id = "bt-ok" text = "__(Connect)"></afx-button> <afx-button data-id = "bt-ok" text = "__(Connect)"></afx-button>
@ -65,6 +66,7 @@ CredentialDialog.scheme = """
<afx-vbox padding="5"> <afx-vbox padding="5">
<afx-input label="__(Username)" data-height="55" data-id="txtUser"></afx-input> <afx-input label="__(Username)" data-height="55" data-id="txtUser"></afx-input>
<afx-input label="__(Password)" data-height="55" type="password" data-id="txtPass"></afx-input> <afx-input label="__(Password)" data-height="55" type="password" data-id="txtPass"></afx-input>
<div></div>
<afx-hbox data-height = '35'> <afx-hbox data-height = '35'>
<div style=' text-align:right;'> <div style=' text-align:right;'>
<afx-button data-id = "bt-ok" text = "__(Ok)"></afx-button> <afx-button data-id = "bt-ok" text = "__(Ok)"></afx-button>
@ -87,14 +89,9 @@ class RemoteDesktop extends this.OS.application.BaseApplication
@zoom.max = 200 @zoom.max = 200
@zoom.value = 100 @zoom.value = 100
@zoom.onvaluechange = (e) => @setScale() @zoom.onvaluechange = (e) => @setScale()
@find("scroll_down").onbtclick = (e) => @switch = @find "capture_mouse"
@container.scrollTop += 20 @switch.onswchange = (e) =>
@find("scroll_up").onbtclick = (e) => @client.mouseCapture = @switch.swon
@container.scrollTop -= 20
@find("scroll_left").onbtclick = (e) =>
@container.scrollLeft -= 20
@find("scroll_right").onbtclick = (e) =>
@container.scrollLeft += 20
@btreset.onbtclick = (e) => @btreset.onbtclick = (e) =>
w = $(@container).width() w = $(@container).width()
h = $(@container).height() h = $(@container).height()

View File

@ -7,7 +7,7 @@
"author": "Dany LE", "author": "Dany LE",
"email": "contact@iohub.dev" "email": "contact@iohub.dev"
}, },
"version":"0.1.15-b", "version":"0.1.16-b",
"dependencies": [], "dependencies": [],
"category":"Internet", "category":"Internet",
"icon": "icon.png", "icon": "icon.png",

View File

@ -365,7 +365,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/RemoteDesktop/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/RemoteDesktop/README.md",
"category": "Internet", "category": "Internet",
"author": "Dany LE", "author": "Dany LE",
"version": "0.1.15-b", "version": "0.1.16-b",
"dependencies": [],"category":"Internet","icon":"icon.png","mimes":["none"], "dependencies": [],"category":"Internet","icon":"icon.png","mimes":["none"],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/RemoteDesktop/build/release/RemoteDesktop.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/RemoteDesktop/build/release/RemoteDesktop.zip"
}, },