Search code examples
macosmouseeventkeystroke

Can I map keystroke to mouse event?


My OS Environment is Mac OS X 10.10.

I want to do some mouse event by a keystroke. If I press a key, then the mouse will click on specific position automatically. For example, left arrow keystroke, then click on (1000,500).

If possible, i want to make a program with above function. (in shell, python, applescript... etc) How can I solve this problem?


Solution

  • A Solution might be using Alfred with Workflows in conjunction with a command line tool that emulates mouse events. I found this tool. CliClick

    Basicly what you would do is:

    1. Add new workflow
    2. Choosing Trigger --> Hotkey
    3. Add an Action --> Run Script

    have fun