sliders/xy: add support for doubleTap address (#174)
This commit is contained in:
parent
3092515cd3
commit
4954295992
5 changed files with 36 additions and 12 deletions
|
|
@ -144,11 +144,23 @@ module.exports = class Xy extends Pad {
|
|||
}, {element: this.wrapper})
|
||||
|
||||
if (this.getProp('doubleTap')) {
|
||||
doubletab(this.wrapper, ()=>{
|
||||
this.faders.x.setValue(this.faders.x.springValue, {sync: false, send:false, dragged:true})
|
||||
this.faders.y.setValue(this.faders.y.springValue, {sync: false, send:false, dragged:true})
|
||||
this.setValue([this.faders.x.springValue,this.faders.y.springValue],{sync:true, send:true})
|
||||
})
|
||||
|
||||
if (typeof this.getProp('doubleTap') === 'string' && this.getProp('doubleTap')[0] === '/') {
|
||||
|
||||
doubletab(this.widget, ()=>{
|
||||
this.sendValue({v:null, address: this.getProp('doubleTap')})
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
doubletab(this.wrapper, ()=>{
|
||||
this.faders.x.setValue(this.faders.x.springValue, {sync: false, send:false, dragged:true})
|
||||
this.faders.y.setValue(this.faders.y.springValue, {sync: false, send:false, dragged:true})
|
||||
this.setValue([this.faders.x.springValue,this.faders.y.springValue],{sync:true, send:true})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (this.getProp('input')) {
|
||||
|
|
|
|||
|
|
@ -54,9 +54,19 @@ class Slider extends Canvas {
|
|||
|
||||
if (this.getProp('doubleTap')) {
|
||||
|
||||
doubletab(this.widget, ()=>{
|
||||
this.setValue(this.springValue,{sync:true, send:true, fromLocal:true})
|
||||
})
|
||||
if (typeof this.getProp('doubleTap') === 'string' && this.getProp('doubleTap')[0] === '/') {
|
||||
|
||||
doubletab(this.widget, ()=>{
|
||||
this.sendValue({v:null, address: this.getProp('doubleTap')})
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
doubletab(this.widget, ()=>{
|
||||
this.setValue(this.springValue,{sync:true, send:true, fromLocal:true})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue