如何使用ReactiveUI检测双键盘

时间:2014-12-06 09:25:34

标签: c# wpf events reactiveui

如何检测双键板(如双键-Enter)和ReactiveUI

1 个答案:

答案 0 :(得分:2)

这个怎么样:

doubleEnter = someWindow.Events().KeyUp
    .Where(x => x.EventArgs.Key == Key.Enter)
    .Buffer(TimeSpan.FromMilliseconds(650), RxApp.MainThreadScheduler)
    .Where(x => x.Length > 1);