Skip to content

itsdmd/cymuk

Repository files navigation

⚠️ This project is currently not maintained since I'm now using xmouseless and use Linux almost exclusively.


cymuk

cymuk (pronounced /ˈsaɪmʌk/) is a lightweight, portable (WIP) and cross-platform Python program that allows you to control the mouse cursor with keyboard.

This project is written in Python 3 with the helps of PyAutoGUI to control the mouse and pynput to listen for keyboard events.

Features

  • Perform actions/movements when a pre-defined key sequence is pressed using Capture mode (default).
  • Automate the actions using a plain text file in Script mode.
  • Convinient Monitor mode to continuously print out the mouse cursor's position on the screen to help with scripting/configuring.
  • WIP: Record mode to record your series of actions and export them as a plain text file.
  • Fully configurable keybindings.
    • Support single keystroke (eg. a).
    • Support "tricky" combinations (eg. Shift+Space and Shift+Alt+Space can be mapped to different actions).
  • Support multiple monitors setup and treat each one individually.
  • Two movement modes:
    • Step: move the cursor by a small amount (default: 10px).
    • Jump: move the cursor to the center of a portion of the screen (see Boundary).

Usage

Requirements

Dependencies

  • Python 3.6+
    • Can technically run on Python 3.0, but for stability 3.6 and upward is strongly recommended.
  • Windows 7+
    • Might run on older systems, but not tested.
  • macOS 10.12+ (see prerequisites)
    • This is just theoretically possible. I don't have a macOS machine (and too busy/lazy to setup a VM) to test it.
  • Linux with X server OR uinput (see prerequisites)

Manual

See MANUAL.

FAQ

Why did you decided to write this?

Who doesn't want to improve their productivity by 1%? I know I do.

Jokes aside, this project is heavily inspired by keynav, a wonderful tool for X11 systems that I have been using for a few years now (I'm a huge fan of keyboard-driven workflows). The 'Jump' mode is basically a clone of keynav's movement style.

However, it's built for X window systems only. Other more cross-platform solutions that I found have problems or lack functionalities that I need; but most importantly, most of them are not open-sourced.

So, I decided to write my own.

Why did you use PyAutoGUI when pynput can also control the mouse cursor?

There are too many platform-related issues and limitations that come with pynput (you can read more about those here. I want to minimize them and only use it for keyboard listening.

Why can't it run in (true) daemon mode?

One of the main purposes of this program is to support multiple platforms. It's hard (and tedious) for me to ensure the program can run stably universally since each platform has its own way to handle background processes and also depends on how one set their system up. Furthermore, running it as an unregistered publisher background service might raise red flags for the system's virus scanner.

Contributing

Since this is a personal, learning-by-doing project, I'm currently don't have any plan to accept any PRs or promise to maintain it in long term. However, if you have any suggestions or found any bugs, feel free to open an issue.