Results 1 to 2 of 2

Thread: Keyboard Input

  1. #1

    Keyboard Input

    Anyone know how to read keyboard combinations in SDL? For example
    what is the best way to detect ALT+F4 or [Shift]+A.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Keyboard Input

    I think combination detection is up to the programmer(you).

    SDL has awesome input features, though. You can practically tell what key has been pressed and unpressed in a queue. So if you make an object with methods or simple array of each key you want to track, you can use this to check for combinations where input control is required.

    I use this aproach in all my games. If you look up my latest game project, you'll see how I do it with my own Keymap System.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •