1 / 16

CHAPTER 5

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

eleanor
Download Presentation

CHAPTER 5

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CHAPTER 5 Input Control © 2008 Cengage Learning EMEA

  2. 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

  3. 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.

  4. 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.

  5. 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.

  6. INPUT DEVICES

  7. INPUT DEVICES

  8. SIX CLASSES OF INPUT • We can identify six classes of logical input devices: • choice devices • locator devices • pick devices • string devices • stroke devices • valuators.

  9. 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.

  10. DIRECTINPUT • DirectInput is thus responsible for the processing of messages sent to and received from physical input devices.

  11. 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].

  12. 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].

  13. 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

  14. 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.

  15. 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].

  16. 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].

More Related