This is called event-driven programming and is accomplished using reactors. It’s a bit advanced, but you can find working examples. The reactor and the function it runs when activated (the “callback function”) could reside in the ACADLTDOC.lsp as well. ...