#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_INPUT_DEVICES_WINDOWMESSAGEKEYBOARD_H #define NUCLEX_INPUT_DEVICES_WINDOWMESSAGEKEYBOARD_H #include "../Buffered/BufferedKeyboard.h" #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN #include namespace Nuclex { namespace Input { namespace Devices { // ------------------------------------------------------------------------------------------- // /// Keyboard that listens in on window messages class WindowMessageKeyboard : public BufferedKeyboard { /// Initializes a new window message based keyboard public: WindowMessageKeyboard(); /// Frees all resources owned by the keyboard public: virtual ~WindowMessageKeyboard(); /// Updates the keyboard's state in accordance to a window message /// Type of message being sent to the window /// First message-dependent parameter /// Second message-dependent parameter /// True if the message was consumed, false if not public: bool ProcessWindowMessage(UINT message, WPARAM parameter1, LPARAM parameter2); /// Whether the input device is currently attached /// True if the input device is attached, otherwise false public: bool IsAttached() const { return true; } /// Retrieves the human-readable name of the input device /// The human-readable name of the input device public: const std::string &GetName() const; private: WindowMessageKeyboard(const WindowMessageKeyboard &); private: WindowMessageKeyboard &operator =(const WindowMessageKeyboard &); }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Input::Devices #endif // NUCLEX_INPUT_DEVICES_WINDOWMESSAGEKEYBOARD_H