chapter 5 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
CHAPTER 5 PowerPoint Presentation
Download Presentation
CHAPTER 5

Loading in 2 Seconds...

play fullscreen
1 / 16

CHAPTER 5 - PowerPoint PPT Presentation


  • 132 Views
  • Uploaded on

CHAPTER 5. Input Control. © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES. In this chapter you will learn about: Input devices Six classes of input DirectInput DirectInput device setup (keyboard, mouse or joystick) Creating a DirectInput object Creating a DirectInput device

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CHAPTER 5' - eleanor


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 5

CHAPTER 5

Input Control

© 2008 Cengage Learning EMEA

learning objectives
LEARNING OBJECTIVES
  • In this chapter you will learn about:
    • Input devices
    • Six classes of input
    • DirectInput
    • DirectInput device setup (keyboard, mouse or joystick)
    • Creating a DirectInput object
    • Creating a DirectInput device
    • Setting the data format of a DirectInput device
    • Setting the cooperative level of a DirectInput device
    • Acquiring a DirectInput device
    • Reading data from a DirectInput device
    • Buffered and immediate data (keyboard, mouse or joystick)
    • Action mapping
    • The specification of actions
    • Setting up an action map
    • Applying an action map to physical devices
    • Applying an action map to a device
    • Retrieving action map data
    • Force feedback
    • Setting up a force feedback device
    • Using effects
    • XInput
input devices
INPUT DEVICES
  • We classify physical input devices into two primary categories:
    • keyboard devices
    • pointing devices.
  • The mouse is by far the most popular and commonly used pointing device.
    • It generates two independent values converted by some API, device interface, or user program into positional data that can be interpreted as screen coordinates.
    • This direct approach is, however, rarely used and these two independent values generated by the device are more commonly interpreted by the device driver as velocities.
input devices4
INPUT DEVICES
  • The main purpose behind using velocities, rather than distance values, lies with the desire to create a variable-sensitivity input device.
  • Variable sensitivity refers to slow movements from rest resulting in nominal changes with rapid mouse movements leading to large changes in the cursor’s onscreen position.
input devices5
INPUT DEVICES
  • The mouse is referred to as a relative-positioning device.
  • Absolute positioning provides a way of linking onscreen data with the device’s physical position.
  • The joystick is another very important input device, especially to the world of computer gaming and simulations.
    • In its simplest form we interpret the motion of its stick in both an x and a y direction. These values are then, just as with the mouse, translated into velocities and subsequently integrated into screen coordinates.
six classes of input
SIX CLASSES OF INPUT
  • We can identify six classes of logical input devices:
    • choice devices
    • locator devices
    • pick devices
    • string devices
    • stroke devices
    • valuators.
directinput
DIRECTINPUT
  • DirectInput is DirectX’s primary input processing API.
  • It provides hardware-independent input control for keyboards, mice, joysticks, gamepads, steering wheels, flight yokes, space balls, paddles, etc.
  • DirectInput’s hardware-independent nature can be attributed to the API interfacing directly with the device drivers.
directinput10
DIRECTINPUT
  • DirectInput is thus responsible for the processing of messages sent to and received from physical input devices.
directinput device setup keyboard mouse or joystick
DirectInput Device Setup (Keyboard, Mouse, or Joystick)
  • Creating a DirectInput Object
  • Creating a DirectInput Device
  • Setting the Data Format of a DirectInput Device
  • Setting the Cooperative Level of a DirectInput Device
  • Acquiring the DirectInput Device
  • Reading Data from a DirectInput Device

[see the textbook and the DirectInput code samples on the book’s website for a complete discussion].

device data
Device Data
  • Buffered as an alternative to Immediate Keyboard Data
  • Buffered as an Alternative to Immediate Mouse Data
  • Buffered as an Alternative to Immediate Joystick Data

[see the textbook and the DirectInput code samples on the book’s website for a complete discussion].

action mapping
Action Mapping
  • Action mapping eliminates the need for hard coded event-object mapping by binding events to virtual control objects
  • Specifying the Actions
  • Setting up the Action Map
  • Applying an Action Map to Physical Devices
  • Applying the Action Map to a Device
  • Retrieving Action Map Data
force feedback
Force Feedback
  • Force feedback is an all-encompassing term used to describe input devices equipped with actuators, motors and resistance-inducing elements that are used for exerting vibration-based forces.
force feedback15
Force Feedback
  • Setting up a Force Feedback Device
  • Using Effects

[see the textbook and the DirectInput Force Feedback code sample on the book’s website for a complete discussion].

xinput
XINPUT
  • XInput, introduced with the release of the Xbox 360 gaming console, allows any computer running Windows XP SP1 or later to interface with an Xbox 360 controller.

[see the textbook and the XInput code sample on the book’s website for a complete discussion].