Gaming

  Home arrow Gaming arrow Page 2 - Improving Input with Joysticks
Watch our Tech Videos 
Dev Hardware Forums 
Computer Cases  
Computer Processors  
Computer Systems  
Digital Cameras  
Flat Panels  
Gaming  
Hardware Guides  
Hardware News  
Input Devices  
Memory  
Mobile Devices  
Motherboards  
Networking Hardware  
Opinions  
PC Cooling  
PC Speakers  
Peripherals  
Power Supply Units  
Software  
Sound Cards  
Storage Devices  
Tech Interviews  
User Experiences  
Video Cards  
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
GAMING

Improving Input with Joysticks
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 14
    2004-09-27

    Table of Contents:
  • Improving Input with Joysticks
  • Calibrating Joysticks
  • Tracking Joystick Movements
  • Revamping the Game Engine for Joysticks
  • Developing the Joystick Code
  • Building the UFO 2 Example
  • Testing the Finished Product

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     

    SEARCH DEV HARDWARE

    Improving Input with Joysticks - Calibrating Joysticks


    (Page 2 of 7 )

    Before getting into the details of how to handle joystick input from a programming perspective, it's worth addressing an important issue related to joysticks: calibration. Calibration is the process of fine-tuning the settings for a joystick so that the handle is properly centered. Joystick calibration is kind of like having your car aligned; when a joystick isn't properly calibrated, it has a tendency to pull to one side. Fortunately, joystick calibration is easy to perform and is readily available from the Windows Control Panel. To access joystick settings, just follow these steps in Windows XP:

    1. Click the Start button and select Control Panel.

    2. Double-click Game Controllers.

    3. Select the joystick (game controller) to calibrate and then click the Properties button.


    Note - Even if you aren't using Windows XP, you'll still find some kind of joystick or controller icon in the Control Panel for calibrating and testing your game controllers. The specifics of calibrating your joystick might be a little different from the steps I've listed, but the general idea is the same.


    After following these steps, you'll be presented with a window that is specific to your particular joystick. In my case, I'm using a Microsoft SideWinder game pad, so the window I see is shown in Figure 7.1.

     morrison

    Figure 7.1 -- The Test window for your joystick should allow you to test the joystick.

    After testing your joystick, you might find that it needs to be calibrated. To calibrate your joystick (game pad), first click the Settings tab, followed by the Calibrate button. This starts the Device Calibration Wizard, which is shown in Figure 7.2.

    morrison

    Figure 7.2 -- The Device Calibration Wizard provides a means of calibrating joysticks in Windows XP.

    Click the Next button to get started calibrating the joystick (see Figure 7.3).

    morrison

    Figure 7.3 -- Calibrating a joystick first involves pressing a button on the joystick without touching the joystick handle (or control pad for game pads).

    The first step in calibrating a joystick is to leave the handle centered and press a button, as shown in Figure 7.3. In the case of a game pad, you simply don't touch the control pad (D-Pad), and then press a button. You are then prompted to calibrate the axes of the joystick by moving the handle or control pad in all of its directions, followed by pressing another button (see Figure 7.4).

    morrison

    Figure 7.4 --  The Device Calibration Wizard determines the range of each joystick axis by asking you to move the handle or control pad in each direction.

    The final step is to leave the handle (control pad) alone once more and press a button. After performing these steps, you can click the Finish button to wrap up the calibration process. Although the steps to calibrating a joystick or game pad might seem trivial, the idea is that your computer is analyzing the range of movement along each axis and properly determining the center point of each. Once the center point and maximum extents are determined, the joystick can then be accurately centered. Again, it's very much like aligning a car so that it steers straight when you aren't touching the steering wheel.

    It is important to calibrate your joystick any time it starts acting strange because it is possible for a joystick to lose calibration over a period of time as it begins to wear mechanically. Your joystick's Properties window usually provides a test option for testing the joystick after you've calibrated it; this helps to make sure that the calibration worked properly. Figure 7.1 shows the test window for the Microsoft SideWinder game pad.

    The test window for a joystick or game pad is great because it quickly allows you to see if the device is working properly. If you get no response when testing a device, you know that something is wrong with the installation. You can also use the test window to see if a joystick or game pad is properly calibrated.

    SamsThis chapter is from Beginning Game Programming, by Michael Morrison (Sams, ISBN: 0672326590). Check it out at your favorite bookstore today.

    Buy this book now.

    More Gaming Articles
    More By Sams Publishing

    blog comments powered by Disqus

    GAMING ARTICLES

    - An Ugly Side to Gaming`s Boy`s Club
    - Wii U Offers Secretly Cool Features
    - OUYA Raises Millions for Open Console Game P...
    - OUYA Kickstarter Project: Bring Back Great G...
    - WWE 13 Video Game: First Look
    - Game Review: Max Payne 3
    - The Top MUD Games
    - Game Review: Tiger Woods PGA Tour 13
    - Game Review:MLB 12 The Show
    - Game Review: Twisted Metal
    - The Top PS Vita Games
    - PlayStation Vita Review
    - Game Review: Star Wars The Old Republic
    - Game Review: WWE 12
    - Video Game Review: X-Men Destiny

    Developer Shed Affiliates

     




    © 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
    KEITHLEE2zdeconfigurator/configs/INFUSIONSOFT_OVERLAY.phpzdeconfigurator/configs/ OFFLOADING INFUSIONSOFTLOADING INFUSIONSOFT 1debug:overlay status: OFF
    overlay not displayed overlay cookie defined: TI_CAMPAIGN_1012_D OVERLAY COOKIE set:
    status off