Sign in to follow this  
  • entries
    122
  • comments
    121
  • views
    68497

Keyboard and USC

Sign in to follow this  

252 views

Cripes!, the Snipes clone


I've been hard at work on the Keyboard class for the past few days. It's taken me longer than I thought to wrap my head around how to approach interactive keyboard input, but I'm getting there. The Keyboard class now has an Update() method to scan for keyboard events and toggle its internal boolean array accordingly; a WaitForKeypress() method that blocks while waiting for a keydown event; and a Pressed() method that returns the number of keys currently down. The Pressed() method is mainly to help work around the fact that if one key is held down, then another key is pressed and released, the initial key stops sending repeating keydown messages. It does, however, send a message when it is released.

So far it works pretty well, the only problem being that holding the arrow key down causes the world to scroll blazingly fast. I'm pretty sure that's just a problem with how I'm responding to input, not with the Keyboard class itself. Browsing through MSDN while I type this reveals that a waitable timer combined with WaitForMultipleObjects() may solve that, though it's just an idea for now.


College Application - USC


About four hours ago, I finally finished my application to the University of Southern California. The deadline is December 1st.. that'd be today. Cutting it a bit close, eh? Here's hoping I get in! :)

~Jonathan
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now