Your explanation of the $reason values is not completely accurate.
If value is equal to "1", we either pressed "ENTER" or Selected another tile.In BricsCAD if $reason is 1, the user must have pressed Enter. If the user selects another tile $reason is 2.