Bug with Grid mousedown and up events

Started by JMack, November 11, 2021, 06:03:31 AM

Previous topic - Next topic

JMack

Hi,

I'm having trouble with the onmousedown and onmouseup events on a grid control.  I'm trying to show a context menu with the onmouseup event with the right mouse button.

It appears that the events are not being triggered correctly.  Attached is a simple project with a grid control and a lisp file with the onmousedown and onmouseup events.  I don't have the dblclicked event enabled and did not debug it.  The command is gridclicks.

Below are the princ outputs when clicking mouse buttons on the grid control.

Left click - the onmouseup event was not triggered
1. OnMouseDown, Button: 1, Flags: 1

double left click - appears to be OK, both events fired.  I'm not sure if the output should be down/up/down/up. onmouseup flag is incorrect.
1. OnMouseDown, Button: 1, Flags: 1
2. OnMouseUp, Button: 1, Flags: 0

middle click: appears to be OK, both events fired. onmouseup flag is incorrect.
1. OnMouseDown, Button: 4, Flags: 16
2. OnMouseUp, Button: 4, Flags: 0

right click: the onmousedown event triggered twice and the onmouseup event was not triggered
1. OnMouseDown, Button: 2, Flags: 2
2. OnMouseDown, Button: 2, Flags: 2

double left click: onmouseup flag is incorrect. I assume the event sequence should be down/up/down/up but the output is not in the correct order.  I don't need to code for a double right click but this is the only way I could get the onmouseup event to trigger for the right button and this is where I want to show the context menu popup.
1. OnMouseDown, Button: 2, Flags: 2
2. OnMouseDown, Button: 2, Flags: 2
3. OnMouseUp, Button: 2, Flags: 0
4. OnMouseDown, Button: 2, Flags: 2

AutoCAD 2021, OpenDCL 9.1.4.1., tested with two different mice.

Any help would be appreciated.

Cheers,
Jamie