00001 #include "MercuryInput.h" 00002 #include "PStack.h" 00003 00005 class DeviceKeyboardW32 : public InputDevice 00006 { 00007 public: 00008 virtual void Init( MString Name ); 00009 virtual bool IsButtonDown( int ButtonNumber ); 00010 virtual int NumButtons(); 00011 virtual void Update( ) ; 00012 virtual InputEvent PopLastEvent(); 00013 00014 static void TickRepeat( unsigned char cChar ) { m_qRepeats.push_back( cChar ); } 00015 private: 00016 unsigned char m_vKeys[256]; 00017 MDeque < InputEvent > m_sEvents; 00018 static MDeque < unsigned char > m_qRepeats; 00019 bool m_bAllKeys[512]; 00020 }; 00021 00023 class Win32Mouse: public CursorDevice 00024 { 00025 public: 00026 Win32Mouse( ); 00027 virtual ~Win32Mouse( ); 00028 virtual void GetPosition( int &x, int &y ); 00029 virtual void Update( ); 00030 static void UpdateFocus( const MString &message, void * data, PStack & info ); 00031 00032 int m_x,m_y; 00033 static bool m_bHasFocus; 00034 bool m_bSubscribed; 00035 }; 00036 00037 /* 00038 * Copyright (c) 2005-2006, Charles Lohr 00039 * All rights reserved. 00040 * 00041 * Redistribution and use in source and binary forms, with or 00042 * without modification, are permitted provided that the following 00043 * conditions are met: 00044 * - Redistributions of source code must retain the above 00045 * copyright notice, this list of conditions and the following disclaimer. 00046 * - Redistributions in binary form must reproduce the above copyright 00047 * notice, this list of conditions and the following disclaimer in 00048 * the documentation and/or other materials provided with the distribution. 00049 * - Neither the name of the Mercury Engine nor the names of its 00050 * contributors may be used to endorse or promote products derived from 00051 * this software without specific prior written permission. 00052 * 00053 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00054 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00055 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00056 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 00057 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00058 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00059 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00060 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00061 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00062 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00063 */