I have a small Script, that is echoing a code, when I'm pressing a key. It uses the following function:
Code: Select all
KEYBOARD="/dev/input/event0"
checkkey() {
dd if="$KEYBOARD" bs=16 count=1 2>/dev/null | hexdump | cut -f8 -d ' ' | head -1
}
Code: Select all
KEY=$(checkkey)
E.g. for Back-Space: 000e
In another Script I have keyboard code definitions like: 0xff0d (which is Enter or Return). In my mentioned script this returns as: 001c
When I'm just entering 000e I don't get the function working by Back-Space key.
So how can I convert this 001c (for Return/Enter) code to get this form of keyboard code, 0xff0d for the use in a gtkdialog script (GUI)?
Is there a function to do such, or some sort of translation-table anywhere?
Do I have to change anything in the above function, checkkey?
Thanks,
RSH