Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRID-NAV navigation with letters: moves the cursor immediately #81

Open
denisdamata opened this issue Sep 21, 2024 · 1 comment
Open

Comments

@denisdamata
Copy link

denisdamata commented Sep 21, 2024

The grid-nav (letter navigation) seemed interesting to me when used in combination with mouseless (or xmouseless). I move the cursor by typing the two letters and then finish with mouseless.

I just want the cursor to be immediately positioned after the second letter of the letter combination is pressed. In more detail, when I type the two letters, the green square shrinks, and then I have to press SPACE (my click 1) to position the cursor in the area I want. The difference is that I want the cursor to be moved as soon as the letter combination is pressed.

@denisdamata denisdamata changed the title GRID-NAV navigarion with letters: moves the cursor immediately GRID-NAV navigation with letters: moves the cursor immediately Sep 21, 2024
@denisdamata
Copy link
Author

denisdamata commented Sep 21, 2024

You can achieve this behavior by making the following workaround in the function void updategrid of keynav.c at line ~660:

...
    nclip_rectangles = rects;
    clip_rectangles = realloc(clip_rectangles, nclip_rectangles * sizeof(XRectangle));
  }
}

static int call_count = 0; // INCUDE THIS!!!

void updategrid(Window win, struct wininfo *info, int apply_clip, int draw) {


     if (draw && apply_clip) { // INCUDE THIS!!!

        call_count++; // INCUDE THIS!!!
        if (call_count == 4){ // INCUDE THIS!!!
          cmd_warp(NULL); // INCUDE THIS!!!
          cmd_end(NULL);  // INCUDE THIS!!!
        return; // INCUDE THIS!!!
        }// INCUDE THIS!!!
    }// INCUDE THIS!!!

  double w = info->w;
  double h = info->h;
  double cell_width;
  ...

Uninstall and install the program for the changes to take effect:

killall keynav; sudo make uninstall; sudo make install

Thanks Claude AI and ChatGPT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant