   raw input class
  hi. have been searching the forums for an input class i could implement in my own game programming, and found this.http://www.gamedev.net/community/forums/topic.asp?topic_id=567637second post.and looking through the code to try and understand it.can understand most of it, even though im not good at that bitwise operations.but this one i don't get.seems like MouseState0 is = 0.so what it does is shift MouseState0 to the left by one, and thats the part i dont get. because 0 is pure zeroes in bits anyway... right?the rest of it i get. it returns 0x3 if MouseState1 is empty, and the bitwise or makes sure to change everything to 1's if MouseState1 is anythin but 0,have i got it right, or am i on the wrong track hereuint8_t riMouseState( uint8_t Button ){return 0x3 & ((MouseState0[Button-1] << 1) | MouseState1[Button-1]);}   
  There's a lot of code in that post you mentioned. It would be more helpful if you actually pasted the specific code you were having problems into this post. That said, from what I can tell MouseState0 is an array that is initialized to 0 but is later assigned some other values (see riProcessMouseMessage). So sure, at one point it might be 0, but then at another point it might be 1 or some other value. And when it is assigned a non-zero value then shifting will accomplish something.   ;  that's exactly it. i cant find anywhere that mousestate0 is anything else than 0, i can only see that mousestate1 is being reset with mousestate0   ;  There is a CopyMemory( MouseState0, MouseState1, sizeof(MouseState0) );in the ri.cpp file (about 3/4 down) ...   ;  ohh didn't see that.thank you.and after writing down alot of zero's and one's on a paper to get some examples, i think i am getting it.but boy that bitwise operation is confusing. you have to think in an entirely different way.   ;  I think I thought this code did it:MouseState1 = MouseState0;if ( MASK_DOWN & rmouse->usButtonFlags ){MouseState1 = 1;MouseTime0 = MouseTime1; // <--- HEREMouseTime1 = Time;}But then I saw the first line. That means that at the HERE line MouseTime1 should be equal to MouseTime0.Then I realized that that line is completely unnecessary. You can just use thisMouseState1 = MouseState0;if ( MASK_DOWN & rmouse->usButtonFlags ){MouseState1 = 1;MouseTime1 = Time;}