question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Add mouse events to PowerShell Engine

See original GitHub issue

Originally posted here: https://github.com/PowerShell/PowerShell/issues/14247

It was recommended to move this to PSReadLine.

Description of the new feature/enhancement

Whereas:

  1. Both tmux and PowerShell are terminal-based applications
  2. tmux supports mouse events, such as click-and-drag to resize panes, select a window, and scroll through history
  3. 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:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
kilasuitcommented, Jul 28, 2023

@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

1reaction
theJasonHelmickcommented, Jul 26, 2023

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found