MacBook 触控板手势:像《少数派报告》中那样移动 Windows

发布于 2024-07-22 07:54:09 字数 432 浏览 3 评论 0原文

借助 MacBook 触控板,我可以用两根手指滚动文档,或者用两根手指并按下 Ctrl 键放大屏幕。

非常有用的是使用类似的手势(3 个手指,或 2 个手指 + 修饰键)移动当前活动的窗口。 是否有现有的工具、脚本允许这种行为? 如果没有的话,这样的程序可以吗? 你能用 AppleScript 做到这一点吗?

我正在考虑类似(伪代码)的东西:

while(true) {
  if (trackpad_move && modifier_key_pressed) {
    window = get_active_window()
    window.moveTo(trackpad[x], trackpad[y])
  }
}  

最终结果应该看起来有点像少数派报告中的那样......

干杯

With the MacBook Trackpad I can scroll documents by using two fingers or zoom into the screen with two fingers and Ctrl pressed.

What could be very useful is to move the currently active window with a similar gesture (3 fingers, or 2 fingers + modifier key). Is there an existing tool, script that allows this behaviour? If not, would this be possible to do program? Could you do this with AppleScript?

I'm thinking of something like (pseudocode):

while(true) {
  if (trackpad_move && modifier_key_pressed) {
    window = get_active_window()
    window.moveTo(trackpad[x], trackpad[y])
  }
}  

The end result should look a bit like in minority report...

Cheers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

⊕婉儿 2024-07-29 07:54:09

在当前版本的 Mac OS X 中,没有公开支持的多点触控手势方法。有一个 私有API提供了一些支持,而Snow Leopard据说有一个公共版本。

至于访问其他进程的窗口,您可以使用 Accessibility API 来完成(请参阅

There isn't a publicly supported way to do multitouch gestures in the current version of Mac OS X. There is a private API that offers some support, and Snow Leopard is said to have a public version.

As for accessing other processes' windows, you can do it with the Accessibility API (see this other question).

梦年海沫深 2024-07-29 07:54:09

我的一个朋友 Bridger Maxwell 也做过类似的事情。 他用拆解的液晶显示器和红外技术创建了自己的多点触控桌子。 他为该设备编写的演示软件名为 Corkboard,它是开源的。 他的代码又使用了 OpenTouch,这是一个用于多模式输入设备的框架。 老实说,我不知道特定设备的支持状态,但我知道 Bridger 使用 Mac 笔记本电脑和他的多点触控桌来运行应用程序本身并处理多点触控事件。

请查看此博文观看视频最终产品的实际应用。

Something similar was done by a friend of mine, Bridger Maxwell. He created his own multi-touch table with a disassembled LCD monitor and infrared technology. The software he wrote as a demo for the device is called Corkboard, and it is open source. His code, in turn, uses OpenTouch, a framework for multi-modal input devices. I honestly don't know the state of support for particular devices, but I know Bridger used a Mac laptop together with his multi-touch table to run the application itself and process multi-touch events.

Check out this blog post to see videos of the end product in action.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文