VTK 中文站
返回Python 示例
Interaction 2026-05-19 1 分钟阅读

Double Click 双击事件示例

通过点击时间间隔识别 VTK 交互中的双击。

import time

last_click = 0

def on_click(obj, event):
    global last_click
    now = time.time()
    if now - last_click < 0.3:
        print("double click")
    last_click = now

VTK 事件系统可以组合出更复杂的交互行为。

原文链接

本文翻译自 VTK 官方示例:

反馈

发现内容错误、链接失效或希望补充案例,可以提交反馈。