   catch mouseclicks, keyboard input
  hey there.i have the following problem: I wanna use a key or a mousebutton to switch the state of something. What I do at the moment is the following:example://Key: 3if(GetKeyState(0x33) & 0x80) {   camera->changeView();}and in my changeView() function I have a state variable, if this is true I will set it to false, and if it''s false I will set it to true......and depending on this I will change the view.now the problem is, that you are holding a key more than one frame, so the changeView function is called more than one time, for example 2 times. And because of that the state changes every frame and at the end I have the wrong state.Now I could use a variable which I give every function which says that the mouse is allready down....but I then I have to give this every function......and I think that''s not nice.So is there a better way to check this? 
  how about a flag, which isnt passed to the function, which gets set to true when the key is down and set to false when it goes back up again (u can trap that as well), then its a simple matter of checking "is keydown and flag not set" before calling the function 