1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This interface is supported by command events, which are dispatched to
9 * XUL elements as a result of mouse or keyboard activation.
13 interface XULCommandEvent : UIEvent
16 * Command events support the same set of modifier keys as mouse and key
19 readonly attribute boolean ctrlKey;
20 readonly attribute boolean shiftKey;
21 readonly attribute boolean altKey;
22 readonly attribute boolean metaKey;
25 * Command events use the same button values as mouse events.
26 * The button will be 0 if the command was not caused by a mouse event.
28 readonly attribute short button;
31 * The input source, if this event was triggered by a mouse event.
33 readonly attribute unsigned short inputSource;
36 * If the command event was redispatched because of a command= attribute
37 * on the original target, sourceEvent will be set to the original DOM Event.
38 * Otherwise, sourceEvent is null.
40 readonly attribute Event? sourceEvent;
43 * Creates a new command event with the given attributes.
46 undefined initCommandEvent(DOMString type,
47 optional boolean canBubble = false,
48 optional boolean cancelable = false,
49 optional Window? view = null,
50 optional long detail = 0,
51 optional boolean ctrlKey = false,
52 optional boolean altKey = false,
53 optional boolean shiftKey = false,
54 optional boolean metaKey = false,
55 optional short buttonArg = 0,
56 optional Event? sourceEvent = null,
57 optional unsigned short inputSource = 0);