-
Notifications
You must be signed in to change notification settings - Fork 95
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
Aggregated contributions #23
Conversation
* make grid black and white with (almost) pixel-perfect align; * do not show grid if area too small (< 4x4);
This way when one is not found, it doesn't stop the inclusion of the rest.
The old path still works.
bug fix: failed when the last char in the config is not a newline Merge remote-tracking branch 'shouya/master'
Merge marekjm's fork (mostly adding install target to Makefile)
Some support for XDG Base Directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! I wasn't aware there was so many patches/forks floating around.
I added some questions inline in the PR. I haven't tested this yet.
Thank you for putting this together.
keynav.c
Outdated
* Let's remove those, as they cause breakage */ | ||
e->state &= ~(Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask); | ||
|
||
/* Ignore LockMask (Numlock, etc) and Mod2Mask (shift, etc) */ | ||
e->state &= ~(LockMask | Mod2Mask); | ||
|
||
/* Ignore different keyboard layouts (e.g. russian) */ | ||
e->state &= ~(1<<13); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a constant definition for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
I think it makes more sense to have a whitelist of modifiers rather than a blacklist, made that change here: mgsloan@2128fd2
Makefile
Outdated
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) | ||
CFLAGS+=$(shell pkg-config --cflags cairo-xlib 2> /dev/null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why split these up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, that wasn't my change. It's been a long time since I've done much makefiles and C, so not sure what makes sense here. It works fine for me either way.
Makefile
Outdated
|
||
keynav.o: keynav_version.h | ||
keynav_version.h: version.sh | ||
|
||
keynav: LDFLAGS+=-Xlinker -rpath=/usr/local/lib | ||
keynav: keynav.o | ||
$(CC) keynav.o -o $@ $(LDFLAGS) -lxdo; \ | ||
$(CC) keynav.o -o keynav $(CFLAGS) $(LDFLAGS) -lxdo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change $@ to keynav
? $@
is the target name, which is keynav
in this case. I'm a little confused; can you help me understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also not my change, pinging @yjftsjthsd-g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My memory fails me, unfortunately. I may have changed it just because $@
was unfamiliar to me; looking now, it appears to be reasonably portable (the current version of the Makefile only works in GNU make, and I'd like to fix that), so I agree that it should be reverted. The only other minor concern would be use in ex. the debug target, but building a differently named debug binary isn't exactly a bad thing.
@@ -216,7 +217,7 @@ dispatch_t dispatch[] = { | |||
|
|||
// Mouse activity | |||
"warp", cmd_warp, | |||
"click", cmd_click, | |||
"click", cmd_click, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing whitespace changes are making the diff harder to read for me, so I am likely to miss some things in review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that, my emacs config automatically trims it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put all traling whitespace changes into a single commit at the very end of the list of patches.
@@ -225,7 +226,8 @@ dispatch_t dispatch[] = { | |||
"daemonize", cmd_daemonize, | |||
"sh", cmd_shell, | |||
"start", cmd_start, | |||
"end", cmd_end, | |||
"end", cmd_end, | |||
"toggle-start", cmd_toggle_start, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ this is a nice feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
char *user_config_file; | ||
|
||
if (config_home && | ||
asprintf(&user_config_file, "%s/keynav/keynavrc", config_home) != -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asprintf is not available on Solaris (by default), but I suspect this is probably not a problem.
+1 to supporting XDG config pathing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the example of where asprintf will fail; I noted that it wasn't portable but I've only been testing on GNU and BSD systems. I've updated yjftsjthsd-g#6 to note that it'll break on Solaris.
keynav.c
Outdated
if (*args == '\0') | ||
args = ""; | ||
else | ||
args++; | ||
|
||
found = 1; | ||
dispatch[i].func(args); | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is ok, probably easier to read if the for loop condition is changed dispatch[i].command && !found
instead of breaking here. (should have the same effect, though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Made that change in mgsloan@0331365
A few fixes, add `toggle-start`, merge other's contributions
@jordansissel Hey! Thanks for the review. I will try to address this stuff next week, been busy. Most of those things are in code that other's wrote. My changes also got merged to https://github.com/yjftsjthsd-g/keynav |
@jordansissel Hey! Sorry for the delay on this. I've added a couple commits addressing comments. Can't do much about the Makefile changes. Perhaps merge and add a commit putting the Makefile back, if you feel strongly about it? |
Also just added a couple fixes that have been bugging me for years, particularly the xrandr thing. No longer will I have to kill and restart keynav when plugging in a display! Being a bit more familiar with the codebase helps. |
Sweet! I will review and merge when I get time hopefully today. Thank you
for making key available better!
…On Sat, Sep 23, 2017 at 10:47 PM Michael Sloan ***@***.***> wrote:
Also added a couple fixes that have been bugging me for years,
particularly the xrandr thing. No longer will I have to kill and restart
keynav when plugging in a display! Being a bit more familiar with the
codebase helps.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIC6sGpriZux7XZ_7S_Czi2fBrK0P84ks5slez8gaJpZM4PDTJC>
.
|
This is a bit inconsistent with other functions, and apparently (I was surprised, too) breaks on the version of gcc shipped with CentOS, which will only accept it if you explicitly declare -std=c99.
Without this change, when a new display is added or an existing display changes size, keynav doesn't use correct starting bounds for its rectangle. I also sometimes get "BadWindow (invalid Window parameter)" from a call of X_GrabKeyboard, consistent with using an invalid root window.
With xmonad (tiling window manager), I can make it so that no window is selected, just by making an empty workspace active. Running a keynav command involving "windowzoom" in this context results in: X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 14 (X_GetGeometry) This fixes that such that keynav no longer crashes in this case, but it does output an error message: XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1) Looks like this is coming from xdotool - https://github.com/jordansissel/xdotool/blob/a70547cf14ab31b3a2900f8bd1e8648ad3633b38/xdo.c#L712 I don't really mind the extra output.
@jordansissel when do you plan to finally merge those fixes? Can't wait to use the up to date and feature rich version of keynav! |
This seems to fix the following X11 error Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 129 (SHAPE) Minor opcode of failed request: 1 (X_ShapeRectangles) Resource id in failed request: 0x0
I believe that the most up-to-date fork of keynav is
https://github.com/yjftsjthsd-g/keynav . Well plus my bugfix PR
yjftsjthsd-g#15
…On Fri, Aug 10, 2018 at 3:06 PM, Axel Beckert ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In keynav.c
<#23 (comment)>:
> @@ -216,7 +217,7 @@ dispatch_t dispatch[] = {
// Mouse activity
"warp", cmd_warp,
- "click", cmd_click,
+ "click", cmd_click,
Maybe put all traling whitespace changes into a single commit at the very
end of the list of patches.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABYKkHsPAR6dnfFmILNAPT3e1K4hM1mks5uPgPbgaJpZM4PDTJC>
.
|
I haven't had much time for this project lately, so I appreciate your patience. The code overall looks good. I'll test it quickly and merge if it compiles and runs. :) |
Alrighty I did a quick test and things seems to be working ok. I think this is a backwards compatible change (Everything I tested worked with my existing keynavrc). Merging! |
Thanks everyone for the combined efforts on these patches. |
No worries, I know how it goes. Thanks for making keynav, I use it all the time. I got a logitech mx ergo wireless mouse 4 months ago and have never needed to recharge the batteries. Hah! |
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry if this information is easy to find, but is there a way to do control-click from keynav?
I tried putting "ctrl+1 click 1" in my .keynavrc but it had no effect - no click happens when i ctrl+1
(i also tried with ctrl-q and there's still no effect)
I just want to be able to control-click on something...am i missing something? thank you
Hmm... off the top of my head, I don’t know if there’s an easy way to do
keyboard-mouse combos like control+click. For today, you’d probably need to
do: xdotool keydown ctrl — click 1 — keyup ctrl
I support adding a way to do this if there isn’t one already :)
…On Tue, Oct 30, 2018 at 5:52 PM jerkey ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In README.md
<#23 (comment)>:
> +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?
I'm sorry if this information is easy to find, but is there a way to do
control-click from keynav?
I tried putting "ctrl+1 click 1" in my .keynavrc but it had no effect - no
click happens when i ctrl+1
(i also tried with ctrl-q and there's still no effect)
I just want to be able to control-click on something...am i missing
something? thank you
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#23 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIC6pS4pKzoPXNYGqGd2STQrFqwS7uZks5uqPRWgaJpZM4PDTJC>
.
|
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 ofstart
andend
based on if keynav is activeFix 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.