mouse handler and collect + store section areas for click locations#129
Draft
otomist wants to merge 1 commit intopythops:masterfrom
Draft
mouse handler and collect + store section areas for click locations#129otomist wants to merge 1 commit intopythops:masterfrom
otomist wants to merge 1 commit intopythops:masterfrom
Conversation
otomist
commented
Feb 27, 2026
| let row = mouse_event.row; | ||
|
|
||
| if let Some(bounds) = app.adapter_block_bounds { | ||
| if col >= bounds.x |
Author
There was a problem hiding this comment.
These checks for location happen multiple times in this function. I can probably make this a bit more DRY to reduce number of changes.
otomist
commented
Feb 27, 2026
| use crossterm::event::{MouseButton, MouseEventKind}; | ||
|
|
||
| match mouse_event.kind { | ||
| MouseEventKind::Down(MouseButton::Left) => { |
Author
There was a problem hiding this comment.
In the name of small PRs and changes I'm only going to add mouse down in this PR but I can get double clicking, right clicking, and scroll working later.
otomist
commented
Feb 27, 2026
|
|
||
| fn to_section(&self, y: u16) -> HelpSection { | ||
| HelpSection { | ||
| label: self.label().trim().to_string(), |
Author
There was a problem hiding this comment.
Label is mostly used for debug I can prob remove it when I implement the calls to the help button functions.
otomist
commented
Feb 27, 2026
| section_indexes.push((nav_item, 0)); | ||
|
|
||
| vec![Line::from(all_spans)] | ||
| } else { |
Author
There was a problem hiding this comment.
If this code looks ok to you I'll go ahead and add the rest of the cases for screen sizes. @pythops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is to add mouse down event handling so users can click and connect to Bluetooth keyboards when they don't have a wired option available for the keyboard.
Currently in draft mode because I wanted to get approval on the basic logic before making all the changes for different screen sizes.
fixes: #100