main
js 65 lines 1.36 KB
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @emails react-core
8 */
9
10 'use strict';
11
12 export const defaultPointerId = 1;
13 export const defaultPointerSize = 23;
14 export const defaultBrowserChromeSize = 50;
15
16 /**
17 * Button property
18 * This property only guarantees to indicate which buttons are pressed during events caused by pressing or
19 * releasing one or multiple buttons. As such, it is not reliable for events such as 'mouseenter', 'mouseleave',
20 * 'mouseover', 'mouseout' or 'mousemove'. Furthermore, the semantics differ for PointerEvent, where the value
21 * for 'pointermove' will always be -1.
22 */
23
24 export const buttonType = {
25 // no change since last event
26 none: -1,
27 // left-mouse
28 // touch contact
29 // pen contact
30 primary: 0,
31 // right-mouse
32 // pen barrel button
33 secondary: 2,
34 // middle mouse
35 auxiliary: 1,
36 // back mouse
37 back: 3,
38 // forward mouse
39 forward: 4,
40 // pen eraser
41 eraser: 5,
42 };
43
44 /**
45 * Buttons bitmask
46 */
47
48 export const buttonsType = {
49 none: 0,
50 // left-mouse
51 // touch contact
52 // pen contact
53 primary: 1,
54 // right-mouse
55 // pen barrel button
56 secondary: 2,
57 // middle mouse
58 auxiliary: 4,
59 // back mouse
60 back: 8,
61 // forward mouse
62 forward: 16,
63 // pen eraser
64 eraser: 32,
65 };