我在一个组件上有一个Java MouseListener来检测鼠标按压。如何判断鼠标在哪个显示器上按下?
@Override
public void mousePressed(MouseEvent e) {
// I want to make something happen on the monitor the user clicked in
}
我试图达到的效果是:当用户在我的应用程序中按下鼠标按钮时,一个弹出窗口会显示一些信息,直到鼠标被释放。我希望确保此窗口位于用户单击的位置,但我需要调整窗口在当前屏幕上的位置,以使整个窗口可见。
我想写一个Applescript在我的外部屏幕上调整Safari窗口的大小。我有一个1440x900的Macbook Air屏幕和一个2560x1440的华硕外置显示器。我想让Safari保持在我的外部显示器上,左边有170像素的间隙。我写了以下基本脚本: tell application "System Events"
tell application "Safari"
activate
set bounds of window 1 to {170, 0, 2560, 1440}
end tell
end te
我已经编写了这个脚本函数
on GetWindowLocation()
set front_app to (path to frontmost application as Unicode text)
tell application front_app
item 1 of (get bounds of front window)
end tell
end GetWindowLocation
on GetDockStatus()
tell application "System Events" to get the autohi