Skip to main content
gamedev.net
🔒 Locked

User Input Listeners

Started by knyot Jan 12, 2003 at 2:36 PM 0 replies 450+ views
Original Post
knyot
knyot
I am trying to make a class to handle user input (right now just keyboard and mouse). I''m thinking of using void pointers to handler functions for each registered class. During each update, if a class is listening for a certain input, its handler function will be called. I have a few questions about the implementation though. First, should I be using a pointer array of each class''s handler functions? Second, I''m encoding the keyboard info in a bool array but how do I encode the mouse information? I''ll use a point for the position but what about each button and scroll feature? Finally, I want this to be as platform independent as possible so is this the right way to be doing this? Should I just use DirectX or are there better alternatives? Thanks for any feedback.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.