retire your mouse.

Related tags

keynav
Overview

keynav

Control the mouse with the keyboard.

Please see http://www.semicomplete.com/projects/keynav

Compiling

You may need some extra libraries to compile keynav. On Debian and Ubuntu you can install these packages:

sudo apt-get install libcairo2-dev libxinerama-dev libxdo-dev

Next you simply run make:

make

This will produce an executable ./keynav which may be run directly (or copied somewhere in your path). You can also install (by default directly to /usr) via make install.

On FreeBSD (and, I expect, other non-GNU platforms), you will want to use gmake.

FAQ

Q: What platforms are supported?
A: keynav should work on nearly any Unix-like that runs X11. It has been confirmed to work on extremely varied GNU/Linux systems (incuding RPM-based, Debian derivatives, musl-based systems, and Arch), and FreeBSD. If you get it to run elsewhere, please let me know so I can add it to the list. If you try to run it on another Unix-like and have trouble, please get in touch and I'll try to help. If attempting to run elsewhere, note that we currently have a dependency on GNU Make (gmake), and it hasn't been tested with many compilers yet.

Q: Does it work on Android/Windows/Wayland/iOS/...?
A: Sadly, no; keynav is totally dependent on X11, and porting it to any other graphical system would really be a clone/rewrite. Although I am aware of no exact analogues on other systems, I suggest looking into Tasker (Android), AutoHotKey (Windows), and AppleScript (macOS). If you find something that works, let me know and I'll consider adding it to this list.

Q: Can I use keynav to scroll?
A: Yes! X11 represents mouse scrolling as key presses, so you just add the relevant stanza to your keynavrc. Mouse buttons are 1=left, 2=middle, 3=right, 4=scroll-up, 5=scroll-down, 6=scroll-left, 7=scroll-right. So for example to scroll up with i and down with e:

i click 4,end
e click 5,end

or to keep scrolling without having to re-invoke keynav, remove the end command from the bindings, like this:

i click 4
Issues
  • Aggregated contributions

    Aggregated contributions

    I wanted to make some changes to keynav, so I took a look at what forks existed. I merged the changes that looked quality to me, and then added some of my own. My changes:

    • Add toggle-start command, a combination of start and end based on if keynav is active

    • Fix a bug where commands are run if there prefixes match. E.g. c runs a bunch of commands and doesn't report an error.

    • Fix a bug where keys are not ungrabbed on clear, if there are multiple commands which begin with start

    I'd offer to maintain, but I do not frequently write code in C, my preferred language is Haskell.

    opened by mgsloan 11
  • make keynav work in different layout

    make keynav work in different layout

    keynav will not work if layout is differ from default. XKB cause e->state to be 8192 if layout group has changed.

    opened by seletskiy 6
  • No command to hold/release a button

    No command to hold/release a button

    Would be helpful to select text from current cursor position to new position, with something like

    shift+w press 1,warp,release 1,end
    

    in conf.

    opened by tshirtman 5
  • start key binding not cleared when clearing keybindings

    start key binding not cleared when clearing keybindings

    There's a global /etc/keynavrc and a personal ~/.keynavrc, and they are parsed in order. I clear all previous key bindings to define my own in ~/.keynavrc. However, the global 'start' keybinding is still there although it does nothing.

    opened by lilydjwg 5
  • Add a playback command to execute recordings.

    Add a playback command to execute recordings.

    Previously, recordings were saved to a normal keybinding, which could possibly shadowed by existing keybindings and thus the recorded key events couldn't be run.

    This commit fixes this by adding a playback command, which works much like vi's @ command (which it is bound to by default).

    For example: qa -> Go into record mode and save to register 'a' ... do stuff ... q -> Stop recording @a -> Play back register 'a'

    opened by aszlig 5
  • Link to website is broken

    Link to website is broken

    The link in the readme — http://www.semicomplete.com/projects/keynav — is now a 404.

    opened by twm 4
  • How can I store pointer location and click back on?

    How can I store pointer location and click back on?

    In vim I could record some actions via 'qa' which means some keysequences would store at register 'a' and I can replay it later via "@a". Can I store pointer location and and click back later on in some sort of ways like vim we do record & play?

    opened by ahmedmohiduet 4
  • on-demand keynav

    on-demand keynav

    People were discussing making it possible to run keynav in an on-demand style, (basically, starting at startup), so that you don't have to have it running all the time ready to grab keys. Was this ever implemented? I can't find anything discussing how to do this.

    Original Thread: https://groups.google.com/forum/#!topic/keynav-users/2coVMkfEyu8

    opened by Radvendii 2
  • Direct support for mod1-5 (resolves issue #19)

    Direct support for mod1-5 (resolves issue #19)

    I hope there is a better (without copy-paste) way to write this, but for now this will do.

    Basically, we need to support at least mod3 and mod4 so that people can start keynav using Hyper and Super keys. Given that there is no universally fixed modifier bit for these keys, we can't just make “hyper” and “super” strings work. Other modifiers (1,2,5) are added for consistency, and also because somebody may actually need them.

    opened by AlexDaniel 2
  • Fixed syntax error in default config file

    Fixed syntax error in default config file

    See issue #26 Cheers

    opened by taigrr 1
  • argument of `record`  does not actually change the file where recordings are stored

    argument of `record` does not actually change the file where recordings are stored

    If you see keynav.c:402

          /* Fail if we try to set the record file to another name than we set
           * previously */
          if (recordings_filename != NULL
              && strcmp(recordings_filename, newrecordingpath)) {
            free(newrecordingpath);
            fprintf(stderr,
                    "Recordings file already set to '%s', you tried to\n"
                    "set it to '%s'. Keeping original value.\n",
                    recordings_filename, path);
          } else {
            recordings_filename = newrecordingpath;
            parse_recordings(recordings_filename);
          }
    

    it is clear that any attempt to set recordings_filename after the first time, fails. Also notice that default settings include q record ~/.keynav_maros, so it is always set to ~/.keynav_macros when the defaults are being set. Hence, one cannot change the file where recordings will be written.

    A simple solution is

    diff --git a/keynav.c b/keynav.c
    index 65abe7c..1c3d2bf 100644
    --- a/keynav.c
    +++ b/keynav.c
    @@ -399,19 +399,10 @@ void addbinding(int keycode, int mods, char *commands) {
             newrecordingpath = strdup(path);
           }
     
    -      /* Fail if we try to set the record file to another name than we set
    -       * previously */
    -      if (recordings_filename != NULL
    -          && strcmp(recordings_filename, newrecordingpath)) {
    -        free(newrecordingpath);
    -        fprintf(stderr,
    -                "Recordings file already set to '%s', you tried to\n"
    -                "set it to '%s'. Keeping original value.\n",
    -                recordings_filename, path);
    -      } else {
    -        recordings_filename = newrecordingpath;
    -        parse_recordings(recordings_filename);
    -      }
    +      if (recordings_filename != NULL)
    +        free(recordings_filename);
    +      recordings_filename = newrecordingpath;
    +      parse_recordings(recordings_filename);
         }
       } /* special config handling for 'record' */
     }
    

    If it helps I can submit a Pull Request.

    opened by gotroyb127 0
  • Add spec file for rpmbuilds and small modification to Makefile

    Add spec file for rpmbuilds and small modification to Makefile

    It would be cool if you guys could merge this so we can build a Fedora Copr release for this

    opened by dhalucario 0
  • Configuring Grid-nav a bit more precisely

    Configuring Grid-nav a bit more precisely

    With Keynav, I have found a workflow that suits my pointing needs nicely. But I had to workaround a little bit the grid-nav directive.

    (please note that on my french keyboard twosuperior is located just above the Tab, i think this is the backquote on QWERTY keyboards).

    Here is my .keynavrc:

    twosuperior start,grid-nav on,grid 15x15 shift+twosuperior grid-nav off,grid 3x3, cell-select 2x2 j move-left 10 k move-down 10 l move-up 10 m move-right 10 space warp, click 1, end

    And my workflow is as follows: 1: I "twosuperior" for the grid-nav. 2: Then I type two letters to identify a rectangle among the 15x15 ones. 3: I then "shift+twosuperior" to quit grid-nav, enable a 3x3 grid at the selected rectangle, and automatically focus on the middle rectangle of that 3x3 grid. 4: I then use jklm to move that rectangle until its location suits my needs. 5: And then I press Space.

    That's really a nice worflow for me. But I feel the step 3 could be launched automatically as a kind of "trigger" upon the selection of the rectangle in the grid-nav.

    Is there any configuration for a workflow like the one above, but with the step 3 being launched automatically without me having to press "shift+twosuperior" ?

    In case this is not possible yet, can we discuss a more fine-grained configuration of the grid-nav directive?

    opened by lolive 1
  • Wayland support: rectangles are not transparent

    Wayland support: rectangles are not transparent

    I recently tried keynav with Wayland (via Sway) on Debian Bullseye. It basically works, except that the rectangles (defining the area where we want to click) are not transparent, meaning that the UX is way worse than on Xorg.

    To be clear, I don't know the technical details about the compatibility layers between Wayland and Xorg, I'm just talking about the end result as of now, on Sway, with the Debian packages.

    I just wanted to report this in case people are looking intro migrating. keynav is too important for me, so I cannot migrate to Sway just yet.

    opened by hiqua 1
  • Feature Requests: support sequence of keys for keybinding and modes in keynavrc

    Feature Requests: support sequence of keys for keybinding and modes in keynavrc

    Feature-1: Sequence of Keys for keybinding

    What?:

    The current supported format in keynavrc is:

    keybinding cmd1,cmd2,cmd3...
    

    However I want to do this:

    {key1, key2, key3...}  {cmd1, cmd2, cmd3...}
    

    When I say {key1, key2, key3...} I do not mean for them to be pressed simultaneously but instead to be able to press them one-after-another. That is, I want keynav to keep listening for key presses till it finds a matching key-sequence to which a command-sequence has been assigned.

    (Remark: Of course the user has to take care to keep all key-sequences prefix-free. But this is similar to expecting the user to not use the same keybinding multiple times in their config file.)

    keynav already implements this in a limited manner with grid-nav. When grid-nav is on, keynav waits for two key-presses before executing the corresponding cell-select command.

    Why?:

    Say, I would like to work on a 20x20 grid and want to assign custom key-bindings for cell-select-ing each of the 400 cells then, there are not enough keybindings for all the cells!

    Feature-2: Modes

    I also want to do something like this:

    keybinding enter-mode <mode-name>
    def mode <mode-name>
    {
        ....
        keybinding cmd1,cmd2,cmd3...
        ....
        Escape exit-mode <mode-name>
    }
    

    And the desired behavior is: When you enter a mode, the keybindings defined for that mode overrides the global keybindings.

    Once again keynav already implements this in a limited manner with grid-nav. Well, grid-nav is like a mode. When grid_nav is on keynav ignores the keybindings in the keynavrc until one Escapes out of grid-nav mode.

    Why?:

    I would like to reuse same keybindings to do different things (like in vim) by some prefacing them with some mode or context. For example I would like my h,j,k,l to do different things depending on whether I am on grid size 3x3 versus on grid size 2x2.

    opened by GeekyPeas 0
  • fix typos in keynav.pod

    fix typos in keynav.pod

    Three typos plus minor change in table design

    opened by Dokumentalista 0
  • Error `Unexpected X11 event: 65` when triggering keynav

    Error `Unexpected X11 event: 65` when triggering keynav

    At some point, which I can't describe with more details, keynav will cause the keyboard to freeze with the error Unexpected X11 event: 65. I have to kill keynav (by jumping in an old-school TTY terminal) in order to get the control of the keyboard back. Once it happens a first time, there's nothing to do. Every time keynav will be restarted and triggered by the appropriate keystroke, the same thing will happen. There nothing to do other than restarting X in order to "fix it" for a while. I don't know how to reproduce for now.

    opened by sim590 7
  • Starting at the last location.

    Starting at the last location.

    I'd like to start keynav at the location where the last one ended. I tried to do this by adding this line to the config file: alt+semicolon start, history-back However, what this actually does is start keynav and goes back in history twice. I'm not sure if this is a bug or I'm just missing something. When start keynav normally, than press the history-back hotkey everything works as expected and the keynav pointer-thing returns to the location the last one ended.

    opened by acosmicjoke 0
  • Drop using {open,close}pixel() in favor of setting input shape to a 0x0 rect

    Drop using {open,close}pixel() in favor of setting input shape to a 0x0 rect

    Part of the X Nonrectangular Window Shape Extension includes the ability to set the input shape. Setting the input shape to what is effectively a 0x0 rectangle results in a grid that cannot be clicked on; clicks and motion events end up being passed to the window below the grid.

    Since this basically achieves what {open,close}pixel() was originally made for, we can just set the input shape as part of the initialization for our window and remove {open,close}pixel() and mouseinfo, as they are no longer needed.

    opened by jabashque 0
  • Debian's package of keynav giving issues: BadAccess

    Debian's package of keynav giving issues: BadAccess

    Hi there! Thanks for your work, it's really appreciated. However, I ran into some issues to get working. My system is Xubuntu 18.04.1 LTS, with i3 window manager.

    I installed keynav with sudo apt install keynav.

    It seems it's installed when I ran it with:

    $ keynav -v
    keynav 0.20110708.0
    

    When I start keynav with $ keynav, I get the following error:

    X Error of failed request:  BadAccess (attempt to access private resource denied)
      Major opcode of failed request:  33 (X_GrabKey)
      Serial number of failed request:  18
      Current serial number in output stream:  22
    
    

    Any idea what's going on there?

    opened by ReneFroger 5
Owner
Jordan Sissel
Jordan Sissel
Display and control your Android device

scrcpy (v1.17) Read in another language This application provides display and control of Android devices connected on USB (or over TCP/IP). It does no

Genymobile 49.4k Jun 4, 2021
Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support

antimicro ?? Important update ?? This repo is currently unmaintained. The code hasn't been updated for a while. But not all is lost, antimicro has a f

null 1.4k Jun 5, 2021
Native Gtk+ Twitter Client

Corebird Corebird will stop working mid-August: https://www.patreon.com/posts/corebirds-future-18921328 Shortcuts Key Description Ctrl + t Compose Twe

Timm Bäder 816 May 31, 2021
Research the web for relevant sources, save them to CrushPaper and then combine them with your own insights into an article.

What is CrushPaper? CrushPaper is for students, writers and anyone who writes papers, essays or articles and quotes their sources. Easily research the

Zap Blasterson 60 Jan 19, 2021
Type emoji easily! Virtual keyboard-like emoji palette for Linux with lots of features.

Emoji keyboard Virtual keyboard-like emoji palette for Linux. If you find this software useful, please Emoji support on Linux is shaky at best. Modern

Tomas Ravinskas 236 Jun 2, 2021
Online genealogy

webtrees - online collaborative genealogy Contents License Coding styles and standards Introduction System requirements Internet browser compatibility

Greg Roach 550 Jun 7, 2021
Open source API management platform

About Fusio is an open source API management platform which helps to build and manage REST APIs. Fusio provides all tools to quickly build an API from

Apioo 970 Jun 5, 2021
Self Hosted Movie, Series and Anime Watch List

Flox Flox is a self hosted Movie, Series and Animes watch list. It's build on top of Laravel and Vue.js and uses The Movie Database API. The rating ba

Viktor Geringer 927 Jun 6, 2021
Personal CRM. Remember everything about your friends, family and business relationships.

Personal Relationship Manager Monica is a great open source personal relationship management system. Introduction Purpose Features Who is it for? What

Monica 12.9k Jun 6, 2021
A black hole for Internet advertisements

Network-wide ad blocking via your own Linux hardware The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content, without installi

Pi-hole 31.4k Jun 5, 2021
A Web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes

2FAuth A web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes 2FAuth Demo Credentials (login - password)

null 125 Jun 6, 2021
🔥 Open source static (serverless) status page. Uses hyperfast Go & Hugo, minimal HTML/CSS/JS, customizable, outstanding browser support (IE8+), preloaded CMS, read-only API, badges & more.

Über fast, backwards compatible (IE8+), tiny, and simple status page built with Hugo. Completely free with Netlify. Comes with Netlify CMS, read-only

cState 1.3k Jun 5, 2021