On Sat, 2003-11-15 at 14:05, Jorge Almeida wrote:
> Sorry for the probably stupid question, but it's killing me...
> I need to write a expect script where the pressing of the control key+
> something needs to be detected. The man page has an example
>       set CTRLZ \032
> where the code \032 corresponds to Control-Z. Now, how can I know the
> codes corresponding to other combinations (e.g. Control-space)? 
> TIA,

Are you trying to use 'bind'? Anyway, look at that man page (for tcl,
not tcp). It discusses keystrokes. If you are after the 'raw' values,
and not the logical ones tcl nicely provides in a system independent
manner, then you are at the mercy of the system originating the key
press. It ceases to be a tcl question.

Here is one very stupid trick I use to decode keypresses. Start vi, then
press 'i', Then press Ctrl-v. Then press the key you want. Then press
the escape key. Save the file. It will contain the keystroke. Dump it
with od.

Although I use Tcl/Tk quite a bit, I have only used expect a bit. I
would imagine there were some hooks to help with this. Just good old
bind, if nothing else.

(



_______________________________________________
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc -> http://smtp.linux-sxs.org/mailman/listinfo/linux-users

Reply via email to