}
}
+ long lastDouleTapTick;
+ const long allowTripleTapTimeSpan = 500;
void gestureRecongnizer_Tapped(GestureRecognizer sender, TappedEventArgs e)
{
bool touched = e.PointerDeviceType == PointerDeviceType.Touch;
this.Document.SelectGrippers.BottomLeft.Enabled = false;
this.Document.SelectGrippers.BottomRight.Enabled = touched;
this.JumpCaret(e.Position);
- if(e.TapCount == 2)
+ if(e.TapCount == 1 && System.DateTime.Now.Ticks - lastDouleTapTick < allowTripleTapTimeSpan * 10000) //トリプルタップ
{
- //タッチスクリーンでトリプルタップした場合、アンカーインデックスを単語の先頭にしないとバグる
+ //タッチスクリーンで行選択した場合、アンカーインデックスを単語の先頭にしないとバグる
+ this.Document.SelectGrippers.BottomLeft.Enabled = touched;
+ this.Document.SelectLine(this.Controller.SelectionStart, touched);
+ }
+ else if(e.TapCount == 2) //ダブルタップ
+ {
+ //タッチスクリーンで単語選択した場合、アンカーインデックスを単語の先頭にしないとバグる
this.Document.SelectGrippers.BottomLeft.Enabled = touched;
if (e.Position.X < this.Render.TextArea.X)
this.Document.SelectLine(this.Controller.SelectionStart, touched);
else
this.Document.SelectWord(this.Controller.SelectionStart, touched);
+ this.lastDouleTapTick = System.DateTime.Now.Ticks;
this.Refresh();
}
}