Git Product home page Git Product logo

keynav's Introduction

keynav

Control the mouse with the keyboard.

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

Related Projects

This project (keynav) only works on X11, but if you want to use a similar tool for Windows, check out keynavish!

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

keynav's People

Contributors

alexdaniel avatar aszlig avatar daboross avatar fidian avatar jordansissel avatar kofish avatar lilydjwg avatar mgsloan avatar seletskiy avatar shouya avatar srgom avatar taigrr avatar yjftsjthsd-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keynav's Issues

Other application can not use ctrl+semicolon after clear command

In my environment, other applications (in particular, Emacs) can not use ctrl+semicolon although I call "clear" in ~/.keynavrc.
For testing, my ~/.keynavrc is the following;

clear
Muhenkan start,windowzoom,warp,cursorzoom 20 20
Escape warp,end
q warp,end

When I commented out the following lines

defaults();
parse_config_file(GLOBAL_CONFIG_FILE);

in keynav.c and I used keynav compiled from the edited source, other application could use ctrl+semicolon.
Therefore, I think that "clear" does not reset key binding of "start" properly.
Does this phenomenon occur in your environment?

I used keynav that is the version installed by the package of Ubuntu 18.04 and "keynav --version" returns "keynav 0.20110708.0".

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?

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.

Keynav on Android?

This is not an issue, but rather a question:
Does keynav support Android? Or do you know of something similar on Android?

Thank you,
Alex Bravo

add offline documentation

Offline documentation (e.g. manpage, keynav -h, keynav showconfig) would be incredibly helpful to me. I'm using keynav with default config at the moment, installed from OpenBSD package (and thus not with source on my system by default). Finding information about default config, or about how to create my own config, currently requires either a web browser plus internet access or keeping a copy of the source archive locally despite the fact it is not even needed to install the software.

Please consider providing offline, console-based documentation options, whether it involves a manpage or output from an option or command to be used in the shell.

Keynav crashes when already daemonized

Keynav doesn't check wheter another instance is already running, crashing when it's asked to be daemonized twice.

[zarel ~]$ keynav
Daemonizing now...
[zarel ~]$ keynav
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: 17
Current serial number in output stream: 25

keynav rectangle is black and fuzzy on the insides on Xubuntu 20.04

Hi,

I'm trying to use keynav built from sources.  Does anybody have any idea as to why I'm seeing this in keynav? (see image below). The image was taken using my cell phone because the key grab prevents taking a screenshot.

This is running under Xubuntu 20.04 on Linux.

I've played around with various changes to the source code, but I cannot see how to fix it. The youtube videos, that demo keynav on Linux that I've seen, do not show that black interior, with fuzzy edges. What might be the cause of this?

Screenshot_2023-01-02_12-57-48

Thanks!

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?

Can it run on NetBSD?

cc keynav.o -o keynav -O2            -Xlinker -rpath=/usr/local/lib -lxdo
keynav.o: In function `cmd_cursorzoom':
keynav.c:(.text+0x1a9): undefined reference to `xdo_get_mouse_location'
keynav.o: In function `cmd_windowzoom':
keynav.c:(.text+0x227): undefined reference to `xdo_get_active_window'
keynav.o: In function `parse_mods':
keynav.c:(.text+0x5de): undefined reference to `g_ptr_array_new'
keynav.c:(.text+0x5fe): undefined reference to `g_ptr_array_add'
keynav.c:(.text+0x619): undefined reference to `xdo_get_symbol_map'
keynav.c:(.text+0x74e): undefined reference to `g_ptr_array_free'
keynav.o: In function `updategrid':
keynav.c:(.text+0xa65): undefined reference to `cairo_move_to'
keynav.c:(.text+0xa84): undefined reference to `cairo_line_to'
keynav.c:(.text+0xb0a): undefined reference to `cairo_new_path'
keynav.c:(.text+0xb89): undefined reference to `cairo_move_to'
keynav.c:(.text+0xba8): undefined reference to `cairo_line_to'
keynav.c:(.text+0xc48): undefined reference to `cairo_copy_path'
keynav.c:(.text+0xcc7): undefined reference to `cairo_new_path'
keynav.c:(.text+0xce3): undefined reference to `cairo_set_source_rgb'
keynav.c:(.text+0xd0a): undefined reference to `cairo_rectangle'
keynav.c:(.text+0xd22): undefined reference to `cairo_set_line_width'
keynav.c:(.text+0xd2e): undefined reference to `cairo_fill'
keynav.c:(.text+0xd62): undefined reference to `cairo_set_source_rgba'
keynav.c:(.text+0xd76): undefined reference to `cairo_set_line_width'
keynav.c:(.text+0xd82): undefined reference to `cairo_stroke'
keynav.o: In function `updategridtext':
keynav.c:(.text+0x101c): undefined reference to `cairo_rectangle'
keynav.c:(.text+0x1034): undefined reference to `cairo_copy_path'
keynav.c:(.text+0x104d): undefined reference to `cairo_set_line_width'
keynav.c:(.text+0x1075): undefined reference to `cairo_set_source_rgb'
keynav.c:(.text+0x1081): undefined reference to `cairo_fill'
keynav.c:(.text+0x1092): undefined reference to `cairo_append_path'
keynav.c:(.text+0x10ae): undefined reference to `cairo_set_source_rgb'
keynav.c:(.text+0x10ba): undefined reference to `cairo_stroke'
keynav.c:(.text+0x10c4): undefined reference to `cairo_path_destroy'
keynav.c:(.text+0x10e0): undefined reference to `cairo_set_source_rgb'
keynav.c:(.text+0x10ec): undefined reference to `cairo_fill'
keynav.c:(.text+0x111e): undefined reference to `cairo_move_to'
keynav.c:(.text+0x112f): undefined reference to `cairo_show_text'
keynav.c:(.text+0x1150): undefined reference to `cairo_set_source_rgb'
keynav.c:(.text+0x115c): undefined reference to `cairo_fill'
keynav.c:(.text+0x116d): undefined reference to `cairo_append_path'
keynav.c:(.text+0x1189): undefined reference to `cairo_set_source_rgb'
keynav.c:(.text+0x1195): undefined reference to `cairo_stroke'
keynav.c:(.text+0x119f): undefined reference to `cairo_path_destroy'
keynav.c:(.text+0x11bb): undefined reference to `cairo_set_source_rgb'
keynav.c:(.text+0x1220): undefined reference to `cairo_new_path'
keynav.c:(.text+0x1238): undefined reference to `cairo_select_font_face'
keynav.c:(.text+0x124c): undefined reference to `cairo_set_font_size'
keynav.c:(.text+0x1262): undefined reference to `cairo_text_extents'
keynav.o: In function `handle_recording':
keynav.c:(.text+0x15e0): undefined reference to `g_ptr_array_free'
keynav.c:(.text+0x15ee): undefined reference to `g_ptr_array_remove_index_fast'
keynav.o: In function `cmd_start':
keynav.c:(.text+0x1bcc): undefined reference to `xdo_set_window_class'
keynav.c:(.text+0x1c30): undefined reference to `cairo_xlib_surface_create'
keynav.c:(.text+0x1c3f): undefined reference to `cairo_create'
keynav.c:(.text+0x1c53): undefined reference to `cairo_set_antialias'
keynav.c:(.text+0x1c64): undefined reference to `cairo_set_line_cap'
keynav.c:(.text+0x1ca4): undefined reference to `cairo_xlib_surface_create_for_bitmap'
keynav.c:(.text+0x1cb3): undefined reference to `cairo_create'
keynav.c:(.text+0x1cce): undefined reference to `cairo_set_line_width'
keynav.c:(.text+0x1cdf): undefined reference to `cairo_set_antialias'
keynav.c:(.text+0x1cf0): undefined reference to `cairo_set_line_cap'
keynav.o: In function `cmd_record':
keynav.c:(.text+0x1ec4): undefined reference to `g_ptr_array_add'
keynav.c:(.text+0x1ef4): undefined reference to `g_ptr_array_new'
keynav.o: In function `parse_recordings':
keynav.c:(.text+0x1f7e): undefined reference to `g_ptr_array_new'
keynav.c:(.text+0x1f99): undefined reference to `g_ptr_array_add'
keynav.c:(.text+0x1fa8): undefined reference to `g_ptr_array_add'
keynav.o: In function `addbinding':
keynav.c:(.text+0x2083): undefined reference to `g_ptr_array_add'
keynav.c:(.text+0x20d2): undefined reference to `g_ptr_array_add'
keynav.o: In function `cmd_warp.part.11':
keynav.c:(.text+0x242d): undefined reference to `xdo_move_mouse'
keynav.c:(.text+0x243f): undefined reference to `xdo_wait_for_mouse_move_to'
keynav.o: In function `cmd_drag':
keynav.c:(.text+0x2501): undefined reference to `xdo_send_keysequence_window_down'
keynav.c:(.text+0x2515): undefined reference to `xdo_mouse_down'
keynav.c:(.text+0x252a): undefined reference to `xdo_move_mouse_relative'
keynav.c:(.text+0x253f): undefined reference to `xdo_move_mouse_relative'
keynav.c:(.text+0x256a): undefined reference to `xdo_send_keysequence_window_up'
keynav.c:(.text+0x25b1): undefined reference to `xdo_mouse_up'
keynav.o: In function `cmd_end.part.12':
keynav.c:(.text+0x2636): undefined reference to `cairo_destroy'
keynav.c:(.text+0x2642): undefined reference to `cairo_surface_destroy'
keynav.c:(.text+0x264e): undefined reference to `cairo_destroy'
keynav.c:(.text+0x265a): undefined reference to `cairo_surface_destroy'
keynav.o: In function `handle_commands':
keynav.c:(.text+0x2d8d): undefined reference to `g_ptr_array_add'
keynav.o: In function `parse_config_line':
keynav.c:(.text+0x2eb8): undefined reference to `g_ptr_array_free'
keynav.c:(.text+0x2ebd): undefined reference to `g_ptr_array_new'
keynav.c:(.text+0x2ffa): undefined reference to `g_ptr_array_free'
keynav.c:(.text+0x2fff): undefined reference to `g_ptr_array_new'
keynav.o: In function `parse_config':
keynav.c:(.text+0x320c): undefined reference to `g_ptr_array_new'
keynav.c:(.text+0x3218): undefined reference to `g_ptr_array_new'
keynav.c:(.text+0x3224): undefined reference to `g_ptr_array_new'
keynav.o: In function `cmd_click.part.0':
keynav.c:(.text+0x4e8): undefined reference to `xdo_click_window'
keynav.o: In function `updategrid':
keynav.c:(.text+0xb24): undefined reference to `cairo_fill'
keynav.c:(.text+0xc6a): undefined reference to `cairo_path_destroy'
keynav.o: In function `main':
keynav.c:(.text.startup+0x12b): undefined reference to `XRRQueryExtension'
keynav.c:(.text.startup+0x2ca): undefined reference to `XRRSelectInput'
*** Error code 1

compile failed

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.

[Ubuntu] start not triggering with most applications

Dearest Maintainer,

I hope things are well. Thank you for your work on this project. I was running keynav fine on Ubuntu 20.04 but I have reinstalled 21.10 (details below). Running keynav gives no errors or warnings. I checked out the code and compiled it. The test seems ok. How do start to debug this?

Thank you for any and all help.
Becker

./test
(EE) 
Fatal server error:
(EE) Server is already active for display 4
	If this server is no longer running, remove /tmp/.X4-lock
	and start again.
(EE) 
x:640 y:512 screen:0 window:1294
x:640 y:512 screen:0 window:1294
./test: 21: kill: No such process

            .-/+oossssoo+/-.               becker@becker-laptop 
        `:+ssssssssssssssssss+:`           -------------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 21.10 x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: XPS 15 7590 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.13.0-19-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 7 hours, 16 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 2044 (dpkg), 11 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 5.1.8 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 3840x2160 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   DE: GNOME 40.5 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   WM Theme: Adwaita 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Theme: Yaru-dark [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Icons: Yaru [GTK2/3] 
  +sssssssssdmydMMMMMMMMddddyssssssss+     Terminal: kitty 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      CPU: Intel i7-9750H (12) @ 4.500GHz 
    .ossssssssssssssssssdMMMNysssso.       GPU: Intel CoffeeLake-H GT2 [UHD Graphics 630] 
      -+sssssssssssssssssyyyssss+-         GPU: NVIDIA GeForce GTX 1650 Mobile / Max-Q 
        `:+ssssssssssssssssss+:`           Memory: 8816MiB / 31718MiB 
            .-/+oossssoo+/-.

On compilation : Failed to include Xrandr (Elementary OS 5)

Hi,

I got this conf :

  • ElementaryOS 5.0 based on Ubuntu 18.04.2 LTS
  • Linux 5.3.7-050307-generic
  • GTK 3.22.30

While using make, I get this output :

4sstylz@bluebook:~/Programs/keynav(master)$ make
sh version.sh --header > keynav_version.h
cc -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16  -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -O2   -c -o keynav.o keynav.c
keynav.c:24:10: fatal error: X11/extensions/Xrandr.h: No such file or directory
 #include <X11/extensions/Xrandr.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'keynav.o' failed
make: *** [keynav.o] Error 1

I have a /etc/x11 folder so I have x11 right ?
But I don’t have any extension folder on it.

In some stack overflow question I understanded that xrandr is provided by x11-server-utils but I cannot install this package with apt.

So my questions are : 

Is keynav compatible with my distro / environnement ?
How to deal with xrandr ?

Thank you.

Makefile: Minor pkg-config call issues

The current code

CFLAGS+=$(shell pkg-config --cflags cairo-xlib xinerama glib-2.0 xext x11 xtst 2> /dev/null || echo -I/usr/X11R6/include -I/usr/local/include)
LDFLAGS+=$(shell pkg-config --libs cairo-xlib xinerama glib-2.0 xext x11 xtst 2> /dev/null || echo -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXtst -lXinerama -lXext -lglib)
LDFLAGS+=$(shell pkg-config --libs glib-2.0)

seems to

  • add glib to LDFLAGS twice
  • add libXtst to CFLAGS and LDFLAGS despite not being a direct linking dependency?:
# lddtree [..]/keynav | grep -v '^        '
keynav => [..]/keynav (interpreter => /lib64/ld-linux-x86-64.so.2)
    libcairo.so.2 => /usr/lib64/libcairo.so.2
    libXinerama.so.1 => /usr/lib64/libXinerama.so.1
    libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0
    libXext.so.6 => /usr/lib64/libXext.so.6
    libX11.so.6 => /usr/lib64/libX11.so.6
    libxdo.so.2 => /usr/lib64/libxdo.so.2
    libc.so.6 => /lib64/libc.so.6

activate keynav with cursorzoom mode by default

Hi there!
I wonder if there's a way to activate the keynav with cursorzoom mode by default?
I have to press the c button to switch to cursorzoom mode after the activation, but I prefer it as my default "global" mode.
Is this functionality supported now?

How do you calculate 21 moves to select any pixel on a screen with 1920x1200 resolution :?

https://www.semicomplete.com/projects/keynav/#why-it-is-fast

keynav is geared towards selecting a piece of the screen very quickly.

Recall from above that you are selecting a region by cutting the
previous region by half. This gives us logarithmic scaling. High
resolution screens incur about the same number of moves to select an
area as smaller screens do.

For example, to select any pixel on a screen with resolution 1920x1200
it would take 21 moves. 21 moves is horrible. There is a bright side!

How often do you really want to click on a single specific pixel on
your screen using your mouse? Never, right? Well, maybe almost
never. Most of the time you want to:

Raise a window and give it focus:
80x80 pixel target (worst: 9 moves)

Click on an "OK" button:
60x25 pixels (worst: 11 moves)

Click on a text widget to activate it:
80x25 or larger

Modifier keys for click

drag supports modifier keys, but clicking doesn't, as far as I know. To circumvent this, dispatching to xdotool with

shift+1 sh "xdotool keydown shift click 1 keyup shift"

works, but it would be nice to be able to specify modifier keys for clicks as well.

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.

Multihead

I can't figure out how to get keynav to work in a multihead environment. I use it with XMonad, where I can switch to a head, but the monitor selection isn't clear to me (there are other tools that also have problems with monitor selection...) It doesn't seem that keynav itself has a "jump to a monitor/workspace" either. I'll gladly adapt to a workflow on this, but I just can't find a way to work on "the other screen" without touching the mouse.

Can it static link?

I wan't it run on the FreeBSD but the cairo library version is too high , can it use the static link?

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?

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.

Problems with dragging windows.

Currently it isn't possible to use the 'drag 1' function to move different windows such a browser. Is there a different drag for this, or is it simply not possible ?

Hyper_L key support?

I usually bind my Capslock key to the Hyper key.
keynav does not seem to works with Hyper_L key

Hyper_L+a start

Please add Hyper Key Support Thanks

Keynav doesn't want to star on Ubuntu X11

Hello

I installed keynav in Ubuntu 20.04.4 LTS with sudo apt-get keynav, it seemed installed keynav -v returned my keynav 0.20180421.git6505bd0d, but unfortunately when I ran keynav it stared but was stuck, it didn't want to show me anything. I installed all the specified dependencies, but it was the same.
Does anyone have any idea how to start the keynav program?

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.

Fatal error when building keynav

When trying to build keynav I'm receiving a fatal error, glib.h can't be found on my system:

xxx@yyy:~/Downloads/keynav-0.20101014.3067$ make
sh version.sh --header > keynav_version.h
cc -I/usr/X11R6/include -I/usr/local/include -pg -g   -c -o keynav.o keynav.c
keynav.c:22:18: fatal error: glib.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
<builtin>: recipe for target 'keynav.o' failed
make: *** [keynav.o] Error 1

But all required packages are installed:

xxx@yyy:~$ dpkg -l | grep libglib
ii  libglib-perl                                3:1.307-3                                  amd64        interface to the GLib and GObject libraries
ii  libglib2.0-0:amd64                          2.46.1-1                                   amd64        GLib library of C routines
ii  libglib2.0-0:i386                           2.46.1-1                                   i386         GLib library of C routines
ii  libglib2.0-0-dbg:amd64                      2.46.1-1                                   amd64        Debugging symbols for the GLib libraries
ii  libglib2.0-0-refdbg:amd64                   2.46.1-1                                   amd64        GLib library of C routines - refdbg library
ii  libglib2.0-bin                              2.46.1-1                                   amd64        Programs for the GLib library
ii  libglib2.0-cil                              2.12.10-5.1                                amd64        CLI binding for the GLib utility library 2.12
ii  libglib2.0-cil-dev                          2.12.10-5.1                                amd64        CLI binding for the GLib utility library 2.12
ii  libglib2.0-data                             2.46.1-1                                   all          Common files for GLib library
ii  libglib2.0-dev                              2.46.1-1                                   amd64        Development files for the GLib library
ii  libglib2.0-tests                            2.46.1-1                                   amd64        GLib library of C routines - installed tests
ii  libglibmm-2.4-1v5:amd64                     2.45.41.is.2.44.0-0ubuntu2                 amd64        C++ wrapper for the GLib toolkit (shared libraries)
xxx@yyy:~$ locate glib.h
/usr/include/reglib/reglib.h
/usr/src/linux-headers-4.2.0-23-generic/include/config/blk/dev/bsglib.h
xxx@yyy:~$ pkg-config --cflags --libs glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0

It's quite obvious, that it has something to do with proper directories, but I'm not able to solve it on my own. Here, here and here are some hints how this problem could be solved.

Using Ubuntu Gnome 15.10 64-bit.

Thanks in advance!

Clicks not working in Dwarf Fortress (steam version)

See title. Keynav works fine in other programs, but trying to click on stuff in Dwarf Fortress does nothing, I can't progress past the main menu. I have a feeling this is specific to DF itself, but I'm making an issue here in the hopes there's a workaround. Ideally a fix for keynav, but if there's an alternative keyboard controlled mouse program that works, I'm open to trying that also :)

Observed on Linux Mint 21 and Xfce 4.16.0. Similar issue happens on Windows when using Keynavish, for the record.

Error in keynav.pod

I get the following output when pasting the default config from the keynav.pod file into ~/.keynavrc:

No keysym found for 'shift-at' in sequence 'shift-at'
Problem parsing keysequence 'shift-at'
Error with config /home/tai//.keynavrc:6: shift-at playback

It was a simple, one character change, see incoming pull request!

ctrl, shift keys to ctrl+click

When clicking, you should be able to hold down ctrl and click using the regular button you have assigned to clicks to get the corresponding behavior that you would get on a mouse:

space warp,click 1,end

Right click appears at current location of cursor instead of centre of frame

I've customized my configuration file to perform "Click 3" when keynav is active and I press Control+r, but the right click menu appears at the location of the cursor instead of where the keynav frame is pointed.

img_20131110_120027

Here's an example. I'm sorry for the photograph, but when keynav is running I can't take a screenshot.

build error on fedora 37

please help me . i want to make it available on copr
Kernel: 6.0.16-300.fc37.x86_64
glib-1:1.2.10-65.fc37.x86_64
libxdo-1:3.20211022.1-1.fc37.x86_64
using xorg but maybe Xinerama ,XSHAPE is missing how can i check

make

`keynav.c:21:10: fatal error: X11/extensions/shape.h: No such file or directory
21 | #include <X11/extensions/shape.h>

  |          ^~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

make: *** [: keynav.o] Error 1`

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.

Start at pointer

I'd like to be able to press a key and start keynav such that the selection is a small-ish box centered at the pointer: do you know if there's any current way to do that?

Thanks very much!

Grid disappears ever other keystroke

When I launch keynav, the grid disappears every-other keystroke. The issue has been reported by another user in the following issue:

NixOS/nixpkgs#30160

Below are the relevant specs for my laptop that may help, let me know if you need anything else:

  • Arch Linux (distro)
  • Linux kernel v. 5.1.4
  • KDE Plasma v. 5.15.5
  • KDE Framework v. 5.58.0
  • Nvidia (proprietary) graphics driver v. 430.14

keynav deactivates when it is small enough

I don't understand why keynav disappears when it gets too small?

If you zoom in too close and make the 4 quadrants small enough, they completely disappear and hitting any key doesn't do anything.

Why is this the default behavior? What it should do is stay at the smallest pixel so the user can undo history or click at the pixel where the pointer is located.

keys leak through

When keynav is activated in front of qutebrowser, I can press ctrl + j and and it will zoom in on the page instead of executing the command I defined in keynavrc:

ctrl+j warp,sh xdotool click 4

I notice this all the time with other keys, where things "leak through" to programs in the background.

Another example is that I use scrcpy to control my Android phone on my computer and if I scroll down using the g key, a 'g' character gets typed into my android phone, even though keynav is active.

g warp,sh xdotool click 4

This seems like a major bug.

Problem with custom xmodmap settings.

I have custom xmodmap mapping. I set CapsLock to Escape and I have Super_L under the mod_2 group.

$ xmodmap
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25)
mod1        Alt_L (0x40),  Alt_L (0xcc)
mod2        Super_L (0x85),  Super_L (0xce)
mod3      
mod4      
mod5        Mode_switch (0x6c),  Mode_switch (0xcb)

Now when I use Super_L+semicolon start (or with super or mod2) in keynavrc it does not work and when I set Escape end only the escape button worked and the CapsLock button did nothing even though in i3wm it works normally as escape.

This could be related to #11.

Or if custom xmodmaps are not supported then I could use just some way of comunicating with the keynav daemon through commandline - I could then set all the keybindings from i3wm where everything works as expected.

GUI does not update correctly when pressing j and l

Tested with Ubuntu 14.04, using Gnome-Shell 3.10.4

When pressing j and l, I expected the coordinate GUI will move down and left, but the actual result was opposite. GUI updated j and l to the opposite direction.

The mouse pointer is updated correctly when pressing ;
Only the GUI part did not work.

Doesnt seem to work in awesomewm ?

I changed

ctrl+space start

and installed using

make

./keynav

to start keynav, but I dont seem to get any reaction from ctrl-space. Semicolon is not easily accessible by my keyboard so it also didn't work with that

"click 1" not work when current pointer located on keynav window line without "warp"?

"click 1" not work when current pointer located on keynav window line without "warp"?
I use default example "keynavrc.jordan" as $HOME/.keynavrc
You can reproduce with xev:

  1. make small xev window area in middle X or Y of the whole screen and expose that running X terminal output area;
  2. Use keynav's "warp" command move to middle X or Y of the whole screen then execute "end" command;
  3. Again execute "start" command, just press "1"(that is the default "click 1" command);
  4. You will see "xev" no report mouse press and release.

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.