Off-Topic > Off-Topic - Tiny Core Lounge

how to automatically get xinput id of keyboard?

<< < (5/5)

GNUser:
Rich, you are over the top in your desire to help! I hope someday I can reciprocate.

Yes, I am aware of those setxkbmap options (take a look at my script's add_keyboard_options function). The point of the script is to allow the Esperantist to not have to conform to the X.org way (Level3_shift--whatever key is chosen--plus c to produce ĉ, for example) but rather to use the common-among-Esperantists x-system (cx to produce ĉ, for example). For Esperantists who are used to the x-system, it is very fast to type that way (vs. having to stop, think, and move one's hands on the keyboard to type any other way).

Note that x-system in this context has nothing to do with X.org, it's just a coincidence that both have X in the name.






Rich:
Hi GNUser
Truth of the matter is I stumbled upon the  Esperanto  reference while perusing the  /usr/local/share/X11/xkb  directory looking
for something else. I just  Googled  a couple of items to try to tie it all together.

GNUser:
Just a quick followup. I found a way to detect keyboard input without needing the keyboard id at all:


--- Code: ---LANG=C xinput --test-xi2 --root | awk '
/RawKeyPress/ { relevant=1 }
relevant==1 && /detail/ { print $2; relevant=0 }
'

--- End code ---

This makes for a good enough keylogger for my purposes. Note that if you put a pipe after the awk command, you need to disable awk's buffer with either { fflush() } or { system("") }. An example of that is here: https://github.com/bdantas/iksilo

Navigation

[0] Message Index

[*] Previous page

Go to full version