📄 4.2.5 输入控制方式的混合使用.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0058)http://www.ekany.com/wdg98/cg/contents/chapter4/les425.htm -->
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>4</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GB2312">
<META content=FrontPage.Editor.Document name=ProgId>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<META content="Microsoft Word 9" name=Originator><LINK
href="les425.files/filelist.xml" rel=File-List><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>zlj</o:Author> <o:Template>Normal</o:Template> <o:LastAuthor>zlj</o:LastAuthor> <o:Revision>2</o:Revision> <o:TotalTime>1</o:TotalTime> <o:Created>1999-04-16T03:00:00Z</o:Created> <o:LastSaved>1999-04-16T03:01:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Company>CSCIMS</o:Company> <o:Lines>1</o:Lines> <o:Paragraphs>1</o:Paragraphs> <o:Version>9.2812</o:Version> </o:DocumentProperties></xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:UseFELayout/> </w:Compatibility> </w:WordDocument></xml><![endif]-->
<STYLE>@font-face {
font-family: 宋体;
}
@font-face {
font-family: 楷体_GB2312;
}
@font-face {
font-family: @宋体;
}
@font-face {
font-family: @楷体_GB2312;
}
@page {mso-page-border-surround-header: no; mso-page-border-surround-footer: no; }
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin: 42.55pt; mso-footer-margin: 49.6pt; mso-paper-source: 0; layout-grid: 15.6pt; }
P.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
LI.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
H3 {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 16pt; MARGIN: 13pt 0cm; TEXT-INDENT: 21.25pt; LINE-HEIGHT: 173%; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: lines-together; mso-fareast-font-family: 楷体_GB2312; mso-font-kerning: 1.0pt; mso-style-next: 正文; mso-outline-level: 3; mso-layout-grid-align: none
}
P.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
LI.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
DIV.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-fareast-language: EN-US; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
P.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
LI.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation; tab-interval: 21.0pt"
vLink=purple link=blue>
<H3 style="TEXT-INDENT: 0cm"><FONT face=楷体_GB2312 size=4><SPAN
style="mso-fareast-language: ZH-CN"><SPAN lang=EN-US>4.2.5 </SPAN><SPAN
style="FONT-FAMILY: 楷体_GB2312; mso-fareast-language: ZH-CN; mso-ascii-font-family: 'Times New Roman'">输入控制方式的混合使用</SPAN></SPAN><SPAN
lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></FONT></H3>
<P class=MsoBodyTextIndent><SPAN style="mso-fareast-language: ZH-CN"><FONT
face=楷体_GB2312
size=4>下面给出一个在不同输入控制方式下同时应用不同的输入设备的情况,其目的是要拖动一个形体在屏幕上运动,当达到最终位置,可按一键来终止这种拖动。这里笔的位置是由取样方式得到的,按钮的输入存放在事件队列中。<SPAN
lang=EN-US><o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN; mso-tab-count: 1"><FONT face=楷体_GB2312
size=4> </FONT></SPAN><FONT face=楷体_GB2312 size=4><SPAN
lang=EN-US>set_locator_mode(1,3,sample);(把光笔设成定位设备)<o:p></o:p></SPAN></FONT></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US><SPAN
style="mso-tab-count: 1"><FONT face=楷体_GB2312 size=4>
</FONT></SPAN><FONT face=楷体_GB2312
size=4>set_choice_mode(1,7,event);(把按钮设成选择设备)<o:p></o:p></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US><SPAN
style="mso-tab-count: 1"><FONT face=楷体_GB2312 size=4>
</FONT></SPAN><FONT face=楷体_GB2312 size=4>if(class==choice) then {<SPAN
style="mso-spacerun: yes">
</SPAN>(如按过按钮键,则停止)<o:p></o:p></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2"><FONT face=楷体_GB2312
size=4> </FONT></SPAN><FONT
face=楷体_GB2312 size=4>sample_locator(1,3,x,y);
(读入笔的位置)<o:p></o:p></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US
style="mso-tab-count: 2"><FONT face=楷体_GB2312
size=4> </FONT></SPAN><SPAN
style="mso-fareast-language: ZH-CN"><FONT face=楷体_GB2312 size=4>(把形体平移到<SPAN
lang=EN-US>x,y处,并输出形体,此处这段程序略)<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN"><SPAN style="mso-tab-count: 2"><FONT
face=楷体_GB2312 size=4>
</FONT></SPAN><FONT face=楷体_GB2312 size=4>await_event(0,class,ws,code);<SPAN
style="mso-spacerun: yes"> </SPAN>}
(检查输入的事件队列)<o:p></o:p></FONT></SPAN></P>
<P class=MsoBodyTextIndent><SPAN style="mso-fareast-language: ZH-CN"><FONT
face=楷体_GB2312
size=4>由上述可知,请求方式是在应用程序的控制下工作的;在取样方式下,允许输入设备和应用程序同时工作;在事件方式下,由输入设备来初始化数据输入,控制数据处理进程,一旦有一种逻辑输入设备以及特定的物理设备已被设成相应的方式后,即可用来输入数据或命令。一个应用程序同时可在几种输入控制方式下应用几个不同的输入设备来进行工作。<SPAN
lang=EN-US><o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-US><FONT face=楷体_GB2312 size=4><![if !supportEmptyParas]><![endif]> <o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-US><A
href="http://www.ekany.com/wdg98/cg/contents/chapter4/les424.htm"><FONT
size=4><FONT face=楷体_GB2312><<SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上一节</SPAN>> </FONT></FONT></A><FONT
size=4> <A
href="http://www.ekany.com/wdg98/cg/contents/chapter4/les431.htm"><<SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下一节</SPAN>>
</A> <A
href="http://www.ekany.com/wdg98/cg/tutorial/chapter4/lesson4-2.htm"><</A></FONT></SPAN><FONT
size=4><A
href="http://www.ekany.com/wdg98/cg/tutorial/chapter4/lesson4-2.htm"><FONT
face=楷体_GB2312><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">返回</SPAN><SPAN
lang=EN-US>></SPAN></FONT></A></FONT></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -