summaryrefslogtreecommitdiffstats
path: root/ui/base/touch/touch_device_win.cc
blob: ba5c2600b16407701a45ca7a33298e2387031c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/base/touch/touch_device.h"
#include "base/win/windows_version.h"
#include <windows.h>

namespace ui {

bool IsTouchDevicePresent() {
  int value = GetSystemMetrics(SM_DIGITIZER);
  return (value & NID_READY) &&
      ((value & NID_INTEGRATED_TOUCH) || (value & NID_EXTERNAL_TOUCH));
}

int MaxTouchPoints() {
  return GetSystemMetrics(SM_MAXIMUMTOUCHES);
}

}  // namespace ui