Coder Social home page Coder Social logo

goku1999 / mouse-control.autohotkey Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 4strid/mouse-control.autohotkey

0.0 0.0 0.0 1.13 MB

AutoHotKey script for controlling the mouse with the keyboard. Fast & easy-to-use, full-fledged software replacement for a physical mouse. WASD / vim movement and vim-inspired key bindings.

License: MIT License

AutoHotkey 100.00%

mouse-control.autohotkey's Introduction

vim_mouse_2.ahk

AutoHotkey script with Vim (and now also WASD!) bindings to control the mouse with the keyboard

Installation

Download the script and binary by cloning this repository from GitHub. (You'll need to install Git if you don't have it.) The command to run is

git clone https://github.com/cutejs/vim_mouse_2.ahk.git

(Or if you're fancy, clone it with SSH)

You can of course also just download it as a zip file, but cloning is recommended as you can keep up to date with git pull. I'm still regularly pushing little updates here and there to make it better and easier to use, so you might want to check periodically.

Running from Source

You should run this script from source; never trust binaries you just find lying around on the Internet, even if it's from a trustworthy source like yours truly :^)

To run it you'll need to install AutoHotkey first. Then you should be able to double click the .ahk file to run the script. Pretty easy right?

Precompiled Binary

As of the latest release, a precompiled version is shipped with the source code so you don't have to install anything at all. Just double click the .exe and you're gucci golden!

If you do it this way, imagine me frowning a bit and seeming mildly disappointed. Just kidding, no judgment here! We're not all programmers after all!

Modes of Input

Like Vim, vim_mouse has modes of input, with "Insert mode" acting like a regular keyboard and "Normal mode" intercepting keys to move and control the mouse instead.

Home or Win Alt n enters Normal mode Insert or Win Alt i enters Insert mode

Normal mode

  • hjkl move the mouse
  • HJKL jump to edges of the screen
  • M jump to center of the screen
  • i left click
  • o right click
  • p middle click
  • v hold down left click
  • V hold down right click (???)
  • e,0,] scroll down
  • y,9,[ scroll up
  • d,} scroll down faster
  • u,{ scroll up faster
  • Y "yank" a window (reposition it) (press i to release)
  • b "back" mouse button
  • n "forward" mouse button
  • Insert,Win+Alt+i enter Insert mode

Normal "WASD" mode

You can also use the WASD keys if they're more natural to you than vim movement keys. Switch into and out of WASD mode with Win Alt r

WASD mode is now the default for Normal mode.

  • wasd move the mouse
  • WASD jump to edges of the screen
  • C jump to center the screen
  • r left click
  • t right click
  • y middle click
  • e scroll down
  • q scroll up

Note that this necessarily unbinds d e and y from their Vim bindings.

Otherwise, it is just a variant of Normal mode and the rest of the hotkeys remain unchanged.

Insert mode

Acts like a normal keyboard.

Home and Win Alt n put you in Normal mode.

Normal "Quick" mode

If you're in persistent Insert mode and just need the mouse keys for a second, you can hold down Capslock to enter Normal "Quick" mode, which has all the same hotkeys as Normal mode and ends when Capslock is released.

Insert "Quick" mode

To quickly edit some text then return to Normal mode, a "quick" mode is also available for Insert. Great for typing into an address bar or a form field. Capslock toggles between Normal and quick Insert mode.

Entering

From Normal mode

  • : enter QI (Quick Insert mode)
  • Capslock toggle between QI and Normal mode
  • f send f then enter QI (for Vimium hotlinks)
  • ^f send ctrl f then enter QI (commonly "search")
  • ^t send ctrl t then enter QI (new tab in the browser)
  • Delete send Delete then enter QI (for quick fixes)
Exiting

From quick Insert mode:

  • ^c exit to Normal mode
  • Enter send Enter then exit to Normal mode
  • Capslock toggle between Quick Insert and Normal mode

Home enters Normal mode Insert enters regular (persistent) Insert mode

Last Remarks

For Vim Purists

"Why doesn't i take me into Insert mode and Escape put me in Normal mode! >:U"

I made i left click. You've got Win Alt i which is a nice and unintrusive variant of i. We didn't even used to have that when Win Alt was part of Quick modes so there you go.

Escape is too useful a key to bind to anything. It was infuriating to hit Escape and not have the expected effect so I took it out.

~ Sorry, nerds :^)

"How come I can't make my own keybindings >:I"

I like these ones. You can fork the repo to make your own, or make a pull request if you want to set up managing an ini file :^)

The mouse moves too fast! (or too slow)

At the top of the file, mouse speed is controlled by two global variables, FORCE and RESISTANCE. FORCE controls acceleration and RESISTANCE causes diminishing returns and implicitly creates a terminal velocity.

Use the uncompiled .ahk script and you can change these to taste.

Contact

Bug reports, questions, feature requests, and pull requests are all welcome. Just open an issue on Github.

mouse-control.autohotkey's People

Contributors

4strid avatar goku1999 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.