forked from desromech/sysmel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
47 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#** | ||
* I represent a particular mouse button. | ||
*# | ||
public enum MouseButton valueType: UInt8; values: #{ | ||
None: 0u8. | ||
Left: 1u8. | ||
Middle: 2u8. | ||
Right: 3u8. | ||
X1: 4u8. | ||
X2: 5u8. | ||
}; definition: { | ||
public inline method asMaskBit => UInt32 | ||
:= 1u32<<(self value asUInt32 - 1u32). | ||
|
||
public inline method isLeft => Boolean | ||
:= self value = MouseButton Left value. | ||
|
||
public inline method isMiddle => Boolean | ||
:= self value = MouseButton Middle value. | ||
|
||
public inline method isRight => Boolean | ||
:= self value = MouseButton Right value. | ||
}. | ||
|
||
#** | ||
* I am a mask of different mouse buttons. | ||
*# | ||
public enum MouseButtonMask bitMask valueType: UInt32; values: #{ | ||
None: 0u32. | ||
Left: MouseButton Left asMaskBit. | ||
Middle: MouseButton Middle asMaskBit. | ||
Right: MouseButton Right asMaskBit. | ||
X1: MouseButton X1 asMaskBit. | ||
X2: MouseButton X2 asMaskBit. | ||
}. |
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