It looks like you're new here. If you want to get involved, click one of these buttons!
I'm trying to implement some GUI updates that allow people to drag a point or edge around with the mouse, I wonder is there a way on the API that let me obtain the mouse click location?
Thank you very much!
Yes there is. But it's not a single "get_mouse_click" function, but rather an API. You'll need to create a "Plugin", register it and wrap your function into the core of the plugin.
You will find some documentation about this concept here: https://www.klayout.de/doc-qt5/code/class_PluginFactory.html.
Plugins are a different approach to user-entry driven features, but eventually they are concept the whole KLayout application is built upon and by using Plugins you will find your code integrates smoothly into the application.
There have been a couple of discussions here (e.g. https://www.klayout.de/forum/discussion/comment/7380). Expectations are to have a simple function, but in fact the API is asynchronous. A Plugin can request exclusive access to the mouse, but only after registering a "mode" which means the application will decide when to grant exclusive control. If you do not consider that in the design of your application, it will be difficult to implement atop of KLayout's API.