| Index: win8/metro_driver/devices_handler.cc
|
| ===================================================================
|
| --- win8/metro_driver/devices_handler.cc (revision 160403)
|
| +++ win8/metro_driver/devices_handler.cc (working copy)
|
| @@ -20,4 +20,37 @@
|
| return hr;
|
| }
|
|
|
| +PointerEventHandler::PointerEventHandler() {
|
| +}
|
| +
|
| +PointerEventHandler::~PointerEventHandler() {
|
| +}
|
| +
|
| +HRESULT PointerEventHandler::Init(winui::Core::IPointerEventArgs* args) {
|
| + mswr::ComPtr<winui::Input::IPointerPoint> pointer_point;
|
| + HRESULT hr = args->get_CurrentPoint(&pointer_point);
|
| + if (FAILED(hr))
|
| + return hr;
|
| +
|
| + mswr::ComPtr<windevs::Input::IPointerDevice> pointer_device;
|
| + hr = pointer_point->get_PointerDevice(&pointer_device);
|
| + if (FAILED(hr))
|
| + return hr;
|
| +
|
| + windevs::Input::PointerDeviceType device_type;
|
| + hr = pointer_device->get_PointerDeviceType(&device_type);
|
| + if (FAILED(hr))
|
| + return hr;
|
| +
|
| + is_mouse_ = (device_type == windevs::Input::PointerDeviceType_Mouse);
|
| + winfoundtn::Point point;
|
| + hr = pointer_point->get_Position(&point);
|
| + if (FAILED(hr))
|
| + return hr;
|
| +
|
| + x_ = point.X;
|
| + y_ = point.Y;
|
| + return S_OK;
|
| +}
|
| +
|
| } // namespace metro_driver
|
|
|