#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_WINRTINPUTMANAGER_H #define NUCLEX_INPUT_WINRTINPUTMANAGER_H #include "Config.h" #if !defined(NUCLEX_INPUT_WINRT) #error This header is intended for WinRT/Metro apps written in C++/CX #endif #include "InputManager.h" #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN #include #include namespace Nuclex { namespace Input { // ------------------------------------------------------------------------------------------- // /// Listens to input received from a WinRT/Metro CoreWindow /// /// The WinRT/Metro input manager simply subscribes to the events of the WinRT /// CoreWindow class. Therefore, it's mainly useful in those cases where you want to /// route input through the InputManager in order to be able to support other platforms /// at a later time or if you're porting a game to WinRT/Metro. /// class WinRTInputManager : public InputManager { /// Initializes a new WinRT input manager public: NUCLEX_INPUT_API WinRTInputManager(Windows::UI::Core::CoreWindow ^window); /// Destroys the WinRT input manager public: NUCLEX_INPUT_API virtual ~WinRTInputManager(); /// Counts the number of keyboards present /// The number of keyboards present on the system /// /// You are guaranteed at least 1 keyboard in all cases, including on mobile /// platforms, where you will be provided with a dummy. /// public: NUCLEX_INPUT_API std::size_t CountKeyboards() const; /// Accesses a keyboard /// Index of the keyboard that will be returned /// The keyboard with the specified index public: NUCLEX_INPUT_API const Devices::Keyboard &GetKeyboard(std::size_t index) const; /// Accesses a keyboard /// Index of the keyboard that will be returned /// The keyboard with the specified index public: NUCLEX_INPUT_API Devices::Keyboard &GetKeyboard(std::size_t index); /// Counts the number of mice present /// The number of mice present on the system /// /// You are guaranteed at least 1 mouse in all cases, including on mobile /// platforms, where you will be provided with a dummy. /// public: NUCLEX_INPUT_API std::size_t CountMice() const; /// Accesses a mouse /// Index of the mouse that will be returned /// The mouse with the specified index public: NUCLEX_INPUT_API const Devices::Mouse &GetMouse(std::size_t index) const; /// Accesses a mouse /// Index of the mouse that will be returned /// The mouse with the specified index public: NUCLEX_INPUT_API Devices::Mouse &GetMouse(std::size_t index); /// Counts the number of game pads present /// The number of game pads present on the system /// /// You are guaranteed at least 4 game pads in all cases, including on mobile /// platforms. If fewer than 4 game pads are connected, dummies will take /// the place of the missing devices. /// public: NUCLEX_INPUT_API std::size_t CountGamePads() const; /// Accesses a game pad /// Index of the game pad that will be returned /// The game pad with the specified index public: NUCLEX_INPUT_API const Devices::GamePad &GetGamePad(std::size_t index) const; /// Accesses a game pad /// Index of the game pad that will be returned /// The game pad with the specified index public: NUCLEX_INPUT_API Devices::GamePad &GetGamePad(std::size_t index); /// Counts the number of touch panels present /// The number of touch panels present on the system /// /// You are guaranteed at least 1 touch panel in all cases, including on /// gaming consoles, where you will be provided with a dummy. /// public: NUCLEX_INPUT_API std::size_t CountTouchPanels() const; /// Accesses a touch panel /// Index of the touch panel that will be returned /// The game pad with the specified index public: NUCLEX_INPUT_API const Devices::TouchPanel &GetTouchPanel(std::size_t index) const; /// Accesses a touch panel /// Index of the touch panel that will be returned /// The game pad with the specified index public: NUCLEX_INPUT_API Devices::TouchPanel &GetTouchPanel(std::size_t index); private: ref struct Impl; // hides private implementation details from the user /// Private implementation details of the input manager private: Impl ^impl; }; // ------------------------------------------------------------------------------------------- // }} // namespace Nuclex::Input #endif // NUCLEX_INPUT_WINDOWSINPUTMANAGER_H