私はjQueryをあまり使用しないので、jQuery拡張機能自体を拡張する方法はわかりませんが、githubのサンプルコードを見ると、これらの行(110-140)に変更を追加する必要があります。
this.sp =
$('<div></div>')
.css({cursor: 'default', position: 'relative'})
.append(
$(this.canvas)
.attr('width', this.settings.width + 'px')
.attr('height', this.settings.height + 'px')
.css({cursor: 'default'})
.mousedown(function(e)
{
e.preventDefault();
e.stopPropagation();
$this.scratch = true;
$this.scratchFunc(e, $this, 'Down');
})
)
$(document)
.mousemove(function(e)
{
if($this.scratch) $this.scratchFunc(e, $this, 'Move');
})
.mouseup(function(e)
{
//make sure we are in draw mode otherwise this will fire on any mouse up.
if($this.scratch)
{
$this.scratch = false;
$this.scratchFunc(e, $this, 'Up');
}
});
このブロックを変更または複製し、mousedown、mousemove、およびmouseupハンドラーの機能を複製するタッチイベントを追加すると、ほとんどの場合そこにいるはずです。