-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
14394ae
commit 67f2a37
Showing
6 changed files
with
351 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,78 @@ | ||
/** | ||
* Defines values that specify the buttons on a pointer device. | ||
* Refer to the W3C standards.(https://www.w3.org/TR/uievents/#dom-mouseevent-button) | ||
* Refer to the W3C standards: | ||
* (https://www.w3.org/TR/uievents/#dom-mouseevent-button) | ||
* (https://www.w3.org/TR/uievents/#dom-mouseevent-buttons) | ||
* Refer to Microsoft's documentation.(https://docs.microsoft.com/en-us/dotnet/api/system.windows.input.mousebutton?view=windowsdesktop-6.0) | ||
*/ | ||
export enum PointerButton { | ||
/** No button. */ | ||
None = 0x0, | ||
/** Indicate the primary pointer of the device (in general, the left button or the only button on single-button devices, used to activate a user interface control or select text) or the un-initialized value. */ | ||
Primary = 0, | ||
/** Indicate the auxiliary pointer (in general, the middle button, often combined with a mouse wheel). */ | ||
Auxiliary = 1, | ||
Primary = 0x1, | ||
/** Indicate the secondary pointer (in general, the right button, often used to display a context menu). */ | ||
Secondary = 2, | ||
Secondary = 0x2, | ||
/** Indicate the auxiliary pointer (in general, the middle button, often combined with a mouse wheel). */ | ||
Auxiliary = 0x4, | ||
/** Indicate the X1 (back) pointer. */ | ||
XButton1 = 3, | ||
XButton1 = 0x8, | ||
/** Indicate the X2 (forward) pointer. */ | ||
XButton2 = 4, | ||
XButton2 = 0x10, | ||
/** Indicate the X3 pointer. */ | ||
XButton3 = 5, | ||
XButton3 = 0x20, | ||
/** Indicate the X4 pointer. */ | ||
XButton4 = 6, | ||
XButton4 = 0x40, | ||
/** Indicate the X5 pointer. */ | ||
XButton5 = 7, | ||
XButton5 = 0x80, | ||
/** Indicate the X6 pointer. */ | ||
XButton6 = 8, | ||
XButton6 = 0x100, | ||
/** Indicate the X7 pointer. */ | ||
XButton7 = 9, | ||
XButton7 = 0x200, | ||
/** Indicate the X8 pointer. */ | ||
XButton8 = 10 | ||
XButton8 = 0x400 | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const _pointerDec2BinMap = [ | ||
PointerButton.Primary, | ||
PointerButton.Auxiliary, | ||
PointerButton.Secondary, | ||
PointerButton.XButton1, | ||
PointerButton.XButton2, | ||
PointerButton.XButton3, | ||
PointerButton.XButton4, | ||
PointerButton.XButton5, | ||
PointerButton.XButton6, | ||
PointerButton.XButton7, | ||
PointerButton.XButton8 | ||
]; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const _pointerBin2DecMap: Record<number, number> = { | ||
/** Primary */ | ||
0x1: 0, | ||
/** Secondary */ | ||
0x2: 2, | ||
/** Auxiliary */ | ||
0x4: 1, | ||
/** XButton1 */ | ||
0x8: 3, | ||
/** XButton2 */ | ||
0x10: 4, | ||
/** XButton3 */ | ||
0x20: 5, | ||
/** XButton4 */ | ||
0x40: 6, | ||
/** XButton5 */ | ||
0x80: 7, | ||
/** XButton6 */ | ||
0x100: 8, | ||
/** XButton7 */ | ||
0x200: 9, | ||
/** XButton8 */ | ||
0x400: 10 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.