Feature Request: Add mouse events to PowerShell Engine
See original GitHub issueOriginally posted here: https://github.com/PowerShell/PowerShell/issues/14247
It was recommended to move this to PSReadLine.
Description of the new feature/enhancement
Whereas:
- Both tmux and PowerShell are terminal-based applications
- tmux supports mouse events, such as click-and-drag to resize panes, select a window, and scroll through history
- PowerShell scripts could benefit from mouse interactions
Proposed technical implementation details (optional)
This might be implemented using a PowerShell “engine event.”
Right-Click Event
The right-click event should include event data that describes the terminal coordinates of the click event.
Register-EngineEvent -Action { Draw-ContextMenu -At $event.Coordinates } -SourceIdentifier [System.Management.Automation.PsEngineEvent]::RightClick
Scroll Event
The scroll up/down event should include event data about the speed / length / height (???) of the scroll.
Example
Register-EngineEvent -Action { GrabAndDisplay-SomeHistoricalLogData } -SourceIdentifier [System.Management.Automation.PsEngineEvent]::ScrollUp
Click Event
The click event should support both a single click and double-click events. Both should include terminal coordinates where the event occurred.
Register-EngineEvent -Action { Perform-AnAction -At $event.Coordinates } -SourceIdentifier [System.Management.Automation.PsEngineEvent]::DoubleClick
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Add mouse events to PowerShell Engine · Issue #14247
tmux supports mouse events, such as click-and-drag to resize panes, select a window, and scroll through history; PowerShell scripts could ...
Read more >windows - Is there a tool to know if a program is requesting ...
I would like to know if a program, e.g. a videogame, has requested to get those events. A powershell script or bat would...
Read more >What is PowerShell and How to Use It: The Ultimate Tutorial
This comprehensive guide explains Windows PowerShell's key uses and features. Learn more about the flexible command-line interface and automation tool.
Read more >Using Experimental Features in PowerShell
Lists the currently available experimental features and how to use them.
Read more >Emulate mouse click on keyboard key press : r/PowerShell
I created an AutoHotkey script to emulate middle mouse button when the tilde key is pressed. IT at my work does not allow...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@GaryAtlan82 once you’ve done that could you please link to this issue so that we can track if/when that feature is added to .NET
@GaryAtlan82 - Thank you for checking on this issue. The majority of the work required would come from .NET – I would suggest adding a feature request to their repository. https://github.com/dotnet/runtime