summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/usb_code_for_event.h
blob: 4bcac776f92a6b7b16e0321199c79d1cd396bffe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2011 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.

#ifndef WEBKIT_PLUGINS_PPAPI_NATIVE_KEY_CODE_CONVERSION_H_
#define WEBKIT_PLUGINS_PPAPI_NATIVE_KEY_CODE_CONVERSION_H_

#include "ppapi/c/pp_stdint.h"

namespace WebKit {
class WebKeyboardEvent;
}

namespace webkit {
namespace ppapi {

// Returns a 32-bit "USB Code" for the key identifier by the supplied
// WebKeyboardEvent.  The supplied event must be a KeyDown or KeyUp.
// The code consists of the USB Page (in the high-order 16-bit word) and
// USB Usage Id of the key.  If no translation can be performed then zero
// is returned.
uint32_t UsbCodeForKeyboardEvent(const WebKit::WebKeyboardEvent& key_event);

}  // namespace ppapi
}  // namespace webkit

#endif  // WEBKIT_PLUGINS_PPAPI_NATIVE_KEY_CODE_CONVERSION_H_