笔记本电脑的编程触摸板 [英] programming touchpad of laptop

查看:225
本文介绍了笔记本电脑的编程触摸板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个程序,该程序可以根据我在触摸板上移动手指的方式来控制光标的移动。我希望我的程序获取用户触摸触摸板的位置,然后我想使用自己的程序控制鼠标的移动。我想用Java做到这一点。我可以用Java做到这一点吗?我想在Windows OS上运行它。我的笔记本电脑的触摸板设备驱动程序是否提供一些API,通过该API我可以获取有关用户何时何地触摸触摸板的信息?

I want to write a program which can control my cursor movements depending on the the way I move my finger on the touchpad. I want my program to get the location where the user touched the touchpad, then I want to control mouse movement using my own program. I want do this in Java. Can I do this in Java? I would like to run it on Windows OS. Does my laptops touchpad device driver provide some API by which I can get the info about when and where the user touched the touchpad?

推荐答案

考虑这种情况。

人员想退出您的程序。他们触摸触控板。您的程序将光标移到了他们没想到的地方。他们感到沮丧和困惑。

Person wants to exit your program. They touch the trackpad. Your program moves the cursor somewhere they didn't expect. They're upset and confused.

他们继续触摸触控板,您的程序继续执行未曾期望的操作。他们发现他们无法控制光标。现在怎么办?

They continue to touch the trackpad, your program continues to do something they didn't expect. They find they're unable to control the cursor. Now what?

通常,让程序移动光标会导致灾难。

Generally, having your program move the cursor is a recipe for disaster.


  1. 光标很难在屏幕上发现。在对话框中执行光标变形的X-windows应用程序可以选择禁用此选项,因为它会造成混淆。

  1. The cursor is hard enough to spot on the screen. X-windows applications which do "cursor warping" to dialog boxes have an option to disable this because it is confusing.

从用户删除光标的控制权由于存在模式问题,因此使计算机(已经非常难以使用)的使用变得更加困难。当程序运行时,发生一件事。当您的程序未运行时,会发生一些不同的事情。

Removing control of the cursor from the user makes the computer (already very hard to use) much harder to use because there's this "mode" thing. When your program is running, one thing happens. When your program is not running, something different happens.

查看 http://java.sun.com/j2se/1.4.2/docs/api/ java / awt / Cursor.html

似乎没有任何方法可以更改光标的位置。它跟踪鼠标。

There do not appear to be any methods to change the cursor's position. It tracks the mouse.

但是,请查看 http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html

具有合成鼠标事件的能力。随意玩。

This has the ability to synthesize mouse events. Feel free to play with it.

这篇关于笔记本电脑的编程触摸板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆