LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 777|回复: 4

怎样实现组合键以表示输入文本的结束?

[复制链接]
发表于 2005-4-4 17:57:56 | 显示全部楼层 |阅读模式
例如CTRL+A,
发表于 2005-4-5 10:20:41 | 显示全部楼层
为什么一定要用组合键呢。ansi里面的32个控制字符0-31能否加以利用呢?
NUL (null)                  
SOH (start of heading)      
STX (start of text)         
ETX (end of text)            
EOT (end of transmission) - Not the same as ETB   
ENQ (enquiry)               
ACK (acknowledge)            
BEL (bell) - Caused teletype machines to ring a bell.  Causes a beep
             in many common terminals and terminal emulation programs.
BS  (backspace) - Moves the cursor (or print head) move backwards (left)
                  one space.
TAB (horizontal tab) - Moves the cursor (or print head) right to the next
                       tab stop.  The spacing of tab stops is dependent
                       on the output device, but is often either 8 or 10.
LF  (NL line feed, new line) - Moves the cursor (or print head) to a new
                               line.  On Unix systems, moves to a new line
                               AND all the way to the left.
VT  (vertical tab)           
FF  (form feed) - Advances paper to the top of the next page (if the
                  output device is a printer).
CR  (carriage return) - Moves the cursor all the way to the left, but does
                        not advance to the next line.
SO  (shift out) - Switches output device to alternate character set.            
SI  (shift in)  - Switches output device back to default character set.
DLE (data link escape)      
DC1 (device control 1)      
DC2 (device control 2)      
DC3 (device control 3)      
DC4 (device control 4)      
NAK (negative acknowledge)   
SYN (synchronous idle)      
ETB (end of transmission block) - Not the same as EOT  
CAN (cancel)                 
EM  (end of medium)  
SUB (substitute)            
ESC (escape)
FS  (file separator)
GS  (group separator)
RS  (record separator)
US  (unit separator)
回复 支持 反对

使用道具 举报

发表于 2005-4-5 10:29:03 | 显示全部楼层
这些控制字符对应的键盘输入如下:
The value for CTRL-A (^A) is 01. The value for CTRL-Z (^Z), which is often used as an end-of-file marker in DOS is 26 (decimal). All the other CTRL-B through CTRL-Y characters fall in between. (CTRL-B is 2, CTRL-C is 3, and so forth.)
回复 支持 反对

使用道具 举报

发表于 2005-4-5 10:51:02 | 显示全部楼层
文件结束标志,在操作系统中用EOF表示。linux下在终端输入Ctrl+D,可以向当前进程发出EOF。表示结束。
各个终端可以会有差异。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-5 12:33:39 | 显示全部楼层
明白!3Q
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表