I'm working on a project using Prompt Toolkit and facing challenges with mouse event handling for complex widget layouts. Specifically, I need to implement "on mouse over" and "on mouse out" events for widgets like Frame and Box, regardless of their nested content.
Objective
The goal is to enhance CLI interactivity by tracking mouse events across various widgets. This includes:
Detecting when the mouse is over a specific widget.
Identifying when the mouse leaves a widget.
Effectively working with containers that have nested elements.
Challenge
Current Prompt Toolkit capabilities seem limited in handling mouse events for nested widgets. While Window controls support mouse events, extending this to more complex containers like Frame or Box with multiple children is problematic. The key issue is tracking mouse position relative to the widget layout, essential for determining widget interaction.
Request
Existing Methods: Are there undocumented features or advanced techniques in Prompt Toolkit for such mouse event handling?
Feature Consideration: If not presently possible, could this feature be a valuable addition to Prompt Toolkit?
Implementation Guidance: Any suggestions for implementing this, either as a contribution or a custom extension, would be greatly appreciated.
This enhancement could significantly improve Prompt Toolkit's utility for interactive CLI applications.
Thank you for your time and consideration.
Osirys and ChatGPT, that helped writing this for me because I’m a stupid human
Overview
I'm working on a project using Prompt Toolkit and facing challenges with mouse event handling for complex widget layouts. Specifically, I need to implement "on mouse over" and "on mouse out" events for widgets like
Frame
andBox
, regardless of their nested content.Objective
The goal is to enhance CLI interactivity by tracking mouse events across various widgets. This includes:
Challenge
Current Prompt Toolkit capabilities seem limited in handling mouse events for nested widgets. While
Window
controls support mouse events, extending this to more complex containers likeFrame
orBox
with multiple children is problematic. The key issue is tracking mouse position relative to the widget layout, essential for determining widget interaction.Request
This enhancement could significantly improve Prompt Toolkit's utility for interactive CLI applications.
Thank you for your time and consideration.
Osirys and ChatGPT, that helped writing this for me because I’m a stupid human