Skip to content

MouseMask

Mousemask bits are given in hexadecimal, they are used to determine what events are captured and passed onto the onmouse function. It is possible to pass in multiple events by combining the hex values, for example, if we want to check for both left and right button up we can set the onmousemask as 0x00000202.

Event typeonmousemask bit valueonmousemask decimal value
left button down0x000000011
left button up0x000000022
left button double click0x000000044
middle button down0x0000001016
middle button up0x0000002032
middle button dbl click0x0000004064
right button down0x00000100256
right button up0x00000200512
right button dbl click0x000004001024
motion0x000010004096

Additionally for onmouse event a parameter called keys is parsed, the values this can have are given below:

Key TypeBit Value
shift down0x00010000
ctrl down 0x00020000
alt down0x00040000
meta down0x00080000