Re: code for control+...?
On Sat, 2003-11-15 at 23:02, Jorge Almeida wrote: 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. I have the Exploring Expect book, which doesn't seem to help in this specific matter. Expect does everything Tcl does. Do Tcl docs apply as well. If using 'bind' would be appropriate when scripting a dialog is another thing. Is there nothing in expect to deal with key bindings? If you use the autoexpect command to record an interaction, I would imagine it would also be useful in finding what key presses look like to Tcl/expect. -- Roger Oberholtzer [EMAIL PROTECTED] ___ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users
code for control+...?
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, -- Jorge Almeida ___ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users
Re: code for control+...?
Jorge Almeida [EMAIL PROTECTED] 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, Greetings, Get yourself an ascii table. Here's a pretty one but you can google for others if you like. http://www.mindspring.com/~joeja/programs.html#PHP The first column shows the control codes produced by the alpha keys in the third column. The keys in the second column don't produce control codes. The lowercase keys either don't produce control codes or produce the same codes as the uppercase key. I'm not sure which. For example, the Z key (132 octal) produces the SUB control character (032 octal). Chris ___ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users
Re: code for control+...?
On Sat, 15 Nov 2003, Chris Kassopulo wrote: Jorge Almeida [EMAIL PROTECTED] 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, Greetings, Get yourself an ascii table. Here's a pretty one but you can google for others if you like. http://www.mindspring.com/~joeja/programs.html#PHP The first column shows the control codes produced by the alpha keys in the third column. The keys in the second column don't produce control codes. The lowercase keys either don't produce control codes or produce the same codes as the uppercase key. I'm not sure which. For example, the Z key (132 octal) produces the SUB control character (032 octal). Thank you for the tip. I didn't know what kind of code I was looking for. The link above doesn't tell me how to get Control-A (for example), but I found it here: http://www.hyperdictionary.com/computing/ascii+character+table Regards, Jorge Almeida ___ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users
Re: code for control+...?
On Sat, 15 Nov 2003 10:15:10 -0500 Chris Kassopulo [EMAIL PROTECTED] wrote: Jorge Almeida [EMAIL PROTECTED] 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+ Greetings, Get yourself an ascii table. Here's a pretty one but you can google for others if you like. man ascii -- --- | Alan K. Jackson| To see a World in a Grain of Sand | | [EMAIL PROTECTED] | And a Heaven in a Wild Flower, | | www.ajackson.org | Hold Infinity in the palm of your hand | | Houston, Texas | And Eternity in an hour. - Blake | --- ___ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users
Re: code for control+...?
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
Re: code for control+...?
On Sat, 15 Nov 2003, Roger Oberholtzer wrote: Are you trying to use 'bind'? No. 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. Actually, I find it a clever trick, and it solves my problem! As you may have guessed, I'm not really a programmer, just an amateur. I knew (after posting) about Control-V in vim, but not about 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. I have the Exploring Expect book, which doesn't seem to help in this specific matter. Thanks! Jorge Almeida ___ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users