Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: key bindings table?



On 02/23/2014 03:40 PM, Bart Schaefer wrote:

Bart:
On Feb 22, 10:35am, Ray Andrews wrote:
}
} Do we have a key bindings table that translates all the various ways of
} referring to a key press?

You can generate one for your terminal/keyboard combo by running the
"zkbd" utility.  As you noticed, $terminfo (from zsh/terminfo module)
sometimes has useful definitions but it's more interested in what the
terminal understands for cursor motion than what the keyboard sends
for input.
Yeah, I was put onto that. The output is easy to understand, but also quite limited. If it coughed up all the possible legal key combos, that would be the thing. I've had some satisfaction from 'dumpkeys' and 'showkey' however.
}
}    [[ "$terminfo[kend]"  == "O"* ]] &&
}    bindkey -M emacs "${terminfo[kend]/O/[}"  end-of-line

I'm not sure which "zbindkey" this refers to.  It's not something that
is distributed with zsh.
No? I wonder where it came from then, maybe I made it myself, to cut KB stuff out of zshrc. Anyway those '$terminfo' lines are certainly not my making since I don't know how they work ;-)

Two of them do, in this case.  Keyboards can be in two states, usually
called "normal mode" and "keypad transmit mode" and the End key sends
different sequences depending on which mode is in effect.  ^E is the
usual emacs end-of-line binding, the other two are End key values.
Yikes, that's a new concept for me.
There are too many interchangable combinations of keyboards and terminals
(and operating systems) to create a table that covers them all.  The zkbd
...

Ok then, I'll make do. I suppose one might wish for a 'complete' output from zkbd, short of that, I can use 'showkey' to check out the codes for a key, and then 'bindkey' to see if/what that key is doing at the moment and 'zkbd' for a nice if incomplete listing of the important keys.


Thanks as always.



Messages sorted by: Reverse Date, Date, Thread, Author