2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / WebCore / dom / KeyboardEvent.idl
blob808319fa1cb3edf70eb599c4e1dc2c1ceb6e91c2
1 /*
2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 module events {
23 // Introduced in DOM Level 3:
24 interface [
25 GenerateConstructor
26 ] KeyboardEvent : UIEvent {
28 #if !defined(LANGUAGE_JAVASCRIPT)
29 // KeyLocationCode
30 const unsigned long KEY_LOCATION_STANDARD = 0x00;
31 const unsigned long KEY_LOCATION_LEFT = 0x01;
32 const unsigned long KEY_LOCATION_RIGHT = 0x02;
33 const unsigned long KEY_LOCATION_NUMPAD = 0x03;
34 #endif
36 readonly attribute DOMString keyIdentifier;
37 readonly attribute unsigned long keyLocation;
38 readonly attribute boolean ctrlKey;
39 readonly attribute boolean shiftKey;
40 readonly attribute boolean altKey;
41 readonly attribute boolean metaKey;
42 readonly attribute boolean altGraphKey;
44 #if !defined(LANGUAGE_JAVASCRIPT)
45 boolean getModifierState(in DOMString keyIdentifierArg);
46 #endif
48 // FIXME: this does not match the version in the DOM spec.
49 void initKeyboardEvent(in DOMString type,
50 in boolean canBubble,
51 in boolean cancelable,
52 in DOMWindow view,
53 in DOMString keyIdentifier,
54 in unsigned long keyLocation,
55 in boolean ctrlKey,
56 in boolean altKey,
57 in boolean shiftKey,
58 in boolean metaKey,
59 in boolean altGraphKey);
61 // WebKit Extensions
62 #if !defined(LANGUAGE_JAVASCRIPT)
63 readonly attribute long keyCode;
64 readonly attribute long charCode;
66 void initKeyboardEvent(in DOMString type,
67 in boolean canBubble,
68 in boolean cancelable,
69 in DOMWindow view,
70 in DOMString keyIdentifier,
71 in unsigned long keyLocation,
72 in boolean ctrlKey,
73 in boolean altKey,
74 in boolean shiftKey,
75 in boolean metaKey);
76 #endif