【问题标题】:xdotool with mountain lion and macbook retinaxdotool 与山狮和 macbook 视网膜
【发布时间】:2012-09-16 20:59:37
【问题描述】:

xdotool 似乎不适用于安装了山狮的新 macbook 视网膜。它启动 XQuartz 但似乎不像以前那样模拟鼠标点击或键盘输入。我不知道它是否与山狮或视网膜显示有关。像 cliclick (http://www.bluem.net/en/mac/cliclick/) 这样的工具似乎可以工作并且可以完成工作。不过,我更喜欢在 mac 和 linux 上都可以使用的工具。有没有人遇到同样的问题?

使用:

  • OS X 10.8.1
  • MacBook Pro 视网膜显示屏
  • 来自 macports 的 xdotool 2.20110530.1
  • XQuartz 2.7.3

【问题讨论】:

    标签: automation osx-mountain-lion ui-automation retina-display


    【解决方案1】:

    我在 Mac OS X 上找到了这个,它和 xdotool 做同样的工作:

    网站网址:http://www.bluem.net/en/mac/cliclick/

    它适用于 Retina Display 和 Mountain Lion。使用起来非常简单。这里是手册:

    cliclick ("Command Line Interface Click") is a tool for executing mouse- and keyboard-related actions from the shell/Terminal
    
    USAGE
      cliclick [-m <mode>] [-r] command1 [command2] [...]
    
    OPTIONS
      -r        Restore initial mouse location when finished
      -m <mode> The mode can be either “verbose” (cliclick will print a
                description of each action to stdout just before it is
                performed) or “test” (cliclick will only print the
                description, but not perform the action)
    
    COMMANDS
    To use cliclick, you pass an arbitrary number of commands as arguments. A command consists of a command identifier (a string that tells cliclick what kind of action to perform) and usually one or more arguments to the command, which are separated from the command identifier by a colon. Example: “c:123,456” is the command for clicking (the “c” is the command identifier for clicking) at the position with x coordinate 123 and y coordinate 456. See below for a list of all commands and the arguments they expect.
    
    LIST OF COMMANDS
    
      m:x,y   MOVE the mouse to the point with the given coordinates.
              Example: “m:12,34” will move the mouse to the point with
              x coordinate 12 and y coordinate 34.
    
      c:x,y   Will CLICK at the point with the given coordinates.
              Example: “c:12,34” will click at the point with x coordinate
              12 and y coordinate 34. Instead of x and y values, you may
              also use “.”, which means: the current position.
    
      dc:x,y  Will DOUBLE-CLICK at the point with the given coordinates.
              Example: “dc:12,34” will double-click at the point with x
              coordinate 12 and y coordinate 34. Instead of x and y values,
              you may also use “.”, which means: the current position.
    
      tc:x,y  Will TRIPLE-CLICK at the point with the given coordinates.
              Example: “tc:12,34” will triple-click at the point with x
              coordinate 12 and y coordinate 34. Instead of x and y values,
              you may also use “.”, which means: the current position.
    
      kd:keys Will trigger a KEY DOWN event for a comma-separated list of
              modifier keys (“cmd”, “alt” or “ctrl”).
              Example: “kd:cmd,alt” will press the command key and the
              option key (and will keep them down until you release them
              with another command)
    
      ku:keys Will trigger a KEY UP event for a comma-separated list of
              modifier keys (“cmd”, “alt” or “ctrl”).
              Example: “ku:cmd,ctrl” will release the command key and the
              control key (which will only have an effect if you performed
              a “key down” before)
    
      p[:str] Will PRINT the given string. If the string is “.”, the
              current MOUSE POSITION is printed. As a convenience, you can skip
              the string completely and just write “p” to get the current position.
              Example: “p:.” or “p” will print the current mouse position
              Example: “p:'Hello world'” will print “Hello world”
    
      w:ms    Will wait/pause for the given number of milliseconds.
              Example: “w:500” will pause command execution for half a second
    
    Version 2.0, released 08/17/2012
    Author: Carsten Blüm, <macapps@bluem.net>
    Website: www.bluem.net/jump/cliclick/
    

    【讨论】:

    • haha "注意:如果你听到“Shell”或“Terminal”这些词时只想到机场和加油站,你可能不需要cliclick,更重要的是:你甚至可能不会能够使用它。”
    猜你喜欢
    • 1970-01-01
    • 2014-03-19
    • 1970-01-01
    • 2013-01-24
    • 1970-01-01
    • 1970-01-01
    • 2015-07-27
    • 1970-01-01
    • 2012-08-08
    相关资源
    最近更新 更多