When using "read -k key" I am matching against normal keys with if [ $key = '?' ] simple control characters like tabs with if (( #key == ##\t )) Ctrl + key sequences with (( #key == ##\C-u )) But how do I match against Alt + key sequences? Thanks, Wendell ________________________________ From: Jérémie Roquet To: zsh-users@zsh.org Cc: nix@myproxylists.com Sent: Wed, March 9, 2011 6:35:48 AM Subject: Re: ZSH's way to bind function to a key in a script? 2011/3/9 : > Can't get it working in a script. Tried both vt100/xterm terminals but nada. > My purpose is this: > > while [ : ] ; do > > ... > > A user press the space button and he will see the script progress .... > > done Then it's unrelated to bindkey ;-) Try this: while [ : ]; do read -ks a [[ $a = ' ' ]] && foo done Have a look at “man zshbuiltins” for more about the “read” builtin. Best regards, -- Jérémie