-
Notifications
You must be signed in to change notification settings - Fork 125
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
Improve interactive tools #352
Conversation
tools/tools-common.c
Outdated
* any non-printable character in the string. | ||
*/ | ||
if (strlen(s) == 1 && (*s <= 0x1F)) { | ||
printf("unicode [ U+%04hX ] ", *s); |
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.
Personally the Unicode wouldn't tell me much as I don't really remember that e.g. newline is U+000A. In that case I'd prefer \n
. But that would be more work, at least I don't know a stdlib function which does this escaping. So +1 from me, this is definitely an improvement.
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 standard notation. I agree every developer prefers the \n
escape sequence, but U+NNNN
is a standard Unicode notation and gives good result in search engine. Anyway you will also have the keysym Return
displayed: I think this is already a good hint.
98d8d0d
to
4dd11a4
Compare
Rebased. This PR requires squashing some commits. Will get to it later. |
Currently the interactive tools print the string result of key strokes as it is, without any escape. This is especially annoying for trivial keysyms such as: Return, BackSpace and Escape. Fix this by displaying the Unicode code point notation (e.g U+000D for Return) for single control characters from the C0 set and DEL. This is a hack: ideally we would like to escape any non-printable character in the utf-8 string.
Display can be cluttered when too many fields are displayed. Add options to hide some default fields
Add an option to print modmap and vmodmap of relevant keys, as well as virtual modifiers mapping to real modifier. This is useful for debugging. It uses private API, so we compile it separately in the fashion of `xkbcli-compile-keymap/compile-keymap`.
4dd11a4
to
fba89ef
Compare
Rebased & squashed. |
I do not think this is controversial and it is very useful for debugging, so I am going to merge this. |
I would like to revive #36 but I realize that I use a bunch of
printf
for debugging modifiers.This MR add new options to
interactive-evdev
for debugging (see commits). Some options use the private API, so I added a non-installable version of the tool with this API.I did not modify the other tools ATM, because
interactive-evdev
seem the most flexible one, being able to load whatever configuration without depending nor impacting the environment.There is one commit that improve the display of control characters from key strokes translation.