Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (39 sloc) 1.01 KB
zmodload zsh/terminfo
typeset -gA key_info
key_info=(
'Control' '\C-'
'Escape' '\e'
'Alt' '\e'
'Meta' '\M-'
'Backspace' '^?'
'Delete' '^[[3~'
'F1' "$terminfo[kf1]"
'F2' "$terminfo[kf2]"
'F3' "$terminfo[kf3]"
'F4' "$terminfo[kf4]"
'F5' "$terminfo[kf5]"
'F6' "$terminfo[kf6]"
'F7' "$terminfo[kf7]"
'F8' "$terminfo[kf8]"
'F9' "$terminfo[kf9]"
'F10' "$terminfo[kf10]"
'F11' "$terminfo[kf11]"
'F12' "$terminfo[kf12]"
'Insert' "$terminfo[kich1]"
'Home' "$terminfo[khome]"
'PageUp' "$terminfo[kpp]"
'End' "$terminfo[kend]"
'PageDown' "$terminfo[knp]"
'Up' "$terminfo[kcuu1]"
'Left' "$terminfo[kcub1]"
'Down' "$terminfo[kcud1]"
'Right' "$terminfo[kcuf1]"
'BackTab' "$terminfo[kcbt]"
)
local key
for key ("${(k)key_info[@]}"); do
if [[ -z "$key_info[$key]" ]]; then
return 1
fi
done
# vim: ft=zsh sts=2 ts=2 sw=2 et fdm=marker fmr={{{,}}}