fix fast scroll speed on macos. (#85)
This commit is contained in:
parent
ffcca402ef
commit
429fc7eb68
@ -86,6 +86,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms.
|
|||||||
- While IP address fetching is now proxy ignored.
|
- While IP address fetching is now proxy ignored.
|
||||||
- Start unmuted on reconnects.
|
- Start unmuted on reconnects.
|
||||||
- Switched to latest firefox version instead of esr.
|
- Switched to latest firefox version instead of esr.
|
||||||
|
- Fixed very fast scroll speed on MacOS.
|
||||||
|
|
||||||
### Roadmap & TODOs
|
### Roadmap & TODOs
|
||||||
- Catch errors from gst pipeline, tell user if broadcast failed.
|
- Catch errors from gst pipeline, tell user if broadcast failed.
|
||||||
|
@ -193,6 +193,8 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import GuacamoleKeyboard from '~/utils/guacamole-keyboard.ts'
|
import GuacamoleKeyboard from '~/utils/guacamole-keyboard.ts'
|
||||||
|
|
||||||
|
const WHEEL_LINE_HEIGHT = 19
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
name: 'neko-video',
|
name: 'neko-video',
|
||||||
components: {
|
components: {
|
||||||
@ -594,6 +596,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wheelThrottle = false
|
||||||
onWheel(e: WheelEvent) {
|
onWheel(e: WheelEvent) {
|
||||||
if (!this.hosting || this.locked) {
|
if (!this.hosting || this.locked) {
|
||||||
return
|
return
|
||||||
@ -603,6 +606,16 @@
|
|||||||
let x = e.deltaX
|
let x = e.deltaX
|
||||||
let y = e.deltaY
|
let y = e.deltaY
|
||||||
|
|
||||||
|
// Pixel units unless it's non-zero.
|
||||||
|
// Note that if deltamode is line or page won't matter since we aren't
|
||||||
|
// sending the mouse wheel delta to the server anyway.
|
||||||
|
// The difference between pixel and line can be important however since
|
||||||
|
// we have a threshold that can be smaller than the line height.
|
||||||
|
if (e.deltaMode !== 0) {
|
||||||
|
x *= WHEEL_LINE_HEIGHT
|
||||||
|
y *= WHEEL_LINE_HEIGHT
|
||||||
|
}
|
||||||
|
|
||||||
if (this.scroll_invert) {
|
if (this.scroll_invert) {
|
||||||
x = x * -1
|
x = x * -1
|
||||||
y = y * -1
|
y = y * -1
|
||||||
@ -611,7 +624,14 @@
|
|||||||
x = Math.min(Math.max(x, -this.scroll), this.scroll)
|
x = Math.min(Math.max(x, -this.scroll), this.scroll)
|
||||||
y = Math.min(Math.max(y, -this.scroll), this.scroll)
|
y = Math.min(Math.max(y, -this.scroll), this.scroll)
|
||||||
|
|
||||||
this.$client.sendData('wheel', { x, y })
|
if (!this.wheelThrottle) {
|
||||||
|
this.wheelThrottle = true
|
||||||
|
this.$client.sendData('wheel', { x, y })
|
||||||
|
|
||||||
|
window.setTimeout(() => {
|
||||||
|
this.wheelThrottle = false
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseDown(e: MouseEvent) {
|
onMouseDown(e: MouseEvent) {
|
||||||
|
Reference in New Issue
Block a user