资源描述:
《chapter 5 input 2. what are input devices课件》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、CHAPTER5InputWhatAreInputDevicesInputDevicesVariousdevicesareavailablefordatainputongraphicsworkstations.Mostsystemshaveakeyboardandoneormoreadditionaldevicesspeciallydesignedforinteractiveinput.Theseincludeamouse,trackball,spaceball,joystick,digitizers,button
2、boxes.SomeotherinputdevicesusedInparticularapplicationsaredatagloves,touchpanels,imagescanners,andvoicesystems.InputdevicesProjectSketchpadcharacterizesinteractivecomputergraphics:UserseesanobjectonthedisplayUserpointsto(picks)theobjectwithaninputdevice(lightp
3、en,mouse,trackball)Objectchanges(moves,rotates)RepeatGraphicalInputDevicescanbedescribedeitherbyPhysicalpropertiesMouseKeyboardTrackballLogicalPropertiesWhatisreturnedtoprogramviaAPIApositionAnobjectidentifierModesHowandwheninputisobtainedRequestoreventPhysica
4、lDevicesmousetrackballlightpendatatabletjoystickspaceballIncremental(Relative)DevicesDevicessuchasthedatatabletreturnapositiondirectlytotheoperatingsystemDevicessuchasthemouse,trackball,andjoystickreturnincrementalinputs(orvelocities)totheoperatingsystemMustin
5、tegratetheseinputstoobtainanabsolutepositionRotationofcylindersinmouseRolloftrackballDifficulttoobtainabsolutepositionCangetvariablesensitivityLogicalDevicesConsidertheCandC++codeC++:cin>>x;C:scanf(“%d”,&x);Whatistheinputdevice?Can’ttellfromthecodeCouldbekeybo
6、ard,file,outputfromanotherprogramThecodeprovideslogicalinputAnumber(anint)isreturnedtotheprogramregardlessofthephysicaldeviceGraphicalLogicalDevicesGraphicalinputismorevariedthaninputtostandardprogramswhichisusuallynumbers,characters,orbitsTwoolderAPIsdefineds
7、ixtypesoflogicalinputLocator:returnapositionPick:returnIDofanobjectKeyboard:returnstringsofcharactersStroke:returnarrayofpositionsValuator:returnfloatingpointnumberChoice:returnoneofnitemsInputModesInputdevicescontainatriggerwhichcanbeusedtosendasignaltotheope
8、ratingsystemButtononmousePressingorreleasingakeyWhentriggered,inputdevicesreturninformation(theirmeasure)tothesystemMousereturnspositioninformationKeyboardreturnsASCIIcodeZMouse&Fo