Comments (7)
Windows supports mouse events which can be read (alongside all other input events) with ReadConsoleInput. However, this means that the Windows input event parsing logic (which would then be based on INPUT_RECORD structs) would have to be decoupled from the Unix logic.
This is quite a bit of work but if the Windows implementation is rewritten to read INPUT_RECORDs, it can also likely use PeekConsoleInput which can replace the WaitForMultipleObjects mechanism introduced in #120 and thereby also solve #24 for the Windows Terminal where the mechanism from #120 does not work reliably.
By the way, a INPUT_RECORD can also be a WINDOW_BUFFER_SIZE_EVENT
which sounds like a good replacement for SIGWINCH
on Windows.
from bubbletea.
If you’re using the Windows Linux Subsystem in Windows Terminal the mouse will work (you can enter the subsystem with wsl
).
Beyond that, I'm not entirely sure if Windows Terminal supports the mouse outside of WSL so we'll need to do some research here. Currently, we're only processing X10/X11 mouse events (which all unix-like systems support).
from bubbletea.
But you did write support for usual win command line
from bubbletea.
@irevenko If it's possible to add native mouse support in Windows we'll definitely do it. In the meantime, you're welcome to submit a PR which adds the functionality.
from bubbletea.
If I remember correctly, gocui has implemented mouse support for Linux and for Windows. Maybe you can take a look at how they did it. Unfortunately I can't do a PR as this is beyond my skill level
from bubbletea.
Bubble Tea now supports mouse events in Windows in master
. This functionality will be available in the next release.
As a technical note, we're only processing X10 mouse events, which are fairly basic across the board. It's possible to ReadConsoleInput
(mentioned by @erikgeiser above) to gain access to higher fidelity mouse events on Windows.
from bubbletea.
This is now available in v0.17.0
.
from bubbletea.
Related Issues (20)
- First line not rendering until event happens HOT 3
- Part of the screen is not rendering when the view is exactly the size of the screen HOT 3
- Proposal: Model v2, program context HOT 1
- Exiting fullscreen glitch when also removing a line in output HOT 2
- Proposal: use x/input to handle input events HOT 1
- `tea.unknownCSISequenceMsg: unknown message type` panics HOT 3
- The visible area in viewport may seem incorrect when content exceed the viewport.Width HOT 10
- Flickering on Windows when using bubbletea >=0.26.0 HOT 2
- Unmanaged Output Truncation (e.g. `tea.Println`) HOT 1
- Show example GIFs on all examples HOT 1
- The input isn't verified before using epoll on it HOT 3
- go version in go.mod is outdated HOT 2
- does Update() get called even when there are no keys being pressed?
- Can't write japanese characters in inputfield HOT 2
- Exit with error message to stderr and non-zero status code
- Async Clipboard
- Automatic command chaining: Cmd -> Cmd -> Msg HOT 1
- Allow WindowSizeMsg to be sent on sub-model Init HOT 5
- Progress bar behaving strangely
- Any support for charts?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bubbletea.