Various properties of mouse events

Source: Internet
Author: User

No matter which type of mouse listener, when a mouse event occurs, the information carried by the event is transmitted through mouseevent.
◆ E. Button: the ID of the mouse button, which is 0, 1, 2 from left to right. If you place the cursor in the left-hand direction, the cursor is arranged from right to left. This attribute is rarely used.
◆ E. statemask: the secondary key that is pressed when the mouse is used, which is the same as the secondary key used by the keyboard. Use the constant SWT. button_mask to determine whether the secondary key is used. For example:
If (E. statemask & SWT. button_mask) = 0 ){
System. Out. println ("no secondary key pressed ");
}
◆ E. X: The X coordinate of the mouse relative to the control that occurs when an event occurs. For example, in this example, the listener registers a button control instead of a window control, so when an event is obtained, the mouse is relative to the X coordinate of the button.
◆ E. Y: when an event occurs, the mouse is relative to the Y coordinate of the control in which the event occurs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.