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 type | onmousemask bit value | onmousemask decimal value |
left button down | 0x00000001 | 1 |
left button up | 0x00000002 | 2 |
left button double click | 0x00000004 | 4 |
middle button down | 0x00000010 | 16 |
middle button up | 0x00000020 | 32 |
middle button dbl click | 0x00000040 | 64 |
right button down | 0x00000100 | 256 |
right button up | 0x00000200 | 512 |
right button dbl click | 0x00000400 | 1024 |
motion | 0x00001000 | 4096 |
Additionally for onmouse event a parameter called keys is parsed, the values this can have are given below:
Key Type | Bit Value |
---|---|
shift down | 0x00010000 |
ctrl down | 0x00020000 |
alt down | 0x00040000 |
meta down | 0x00080000 |