mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
14 lines
282 B
Text
14 lines
282 B
Text
typeset -A Keytable
|
|
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
|
|
function keybind # key action
|
|
{
|
|
typeset key=$(print -f "%q" "$2")
|
|
case $# in
|
|
2) Keytable[$1]='.sh.edchar=${.sh.edmode}'"$key"
|
|
;;
|
|
1) unset Keytable[$1]
|
|
;;
|
|
*) print -u2 "Usage: $0 key [action]"
|
|
;;
|
|
esac
|
|
}
|