Skip to content

Commit

Permalink
Fix hotkeys for macOS
Browse files Browse the repository at this point in the history
Well that was a weird fix. It doesn't seem like crossterm's support for my macOS terminal is very good. Control+M generates a `KeyCode::Enter` event. All Alt+letter hotkeys generate an event for some non-ascii character with no modifiers set. You get a different character for every key you press with Alt. It seems like maybe some or all of this issue might be being tracked at crossterm-rs/crossterm#685

Plus I'm trying to avoid default macOS hotkeys. I also updated crossterm hoping that it would address some of the above problems but it did not.

So yeah, a little bit of a messy update.
  • Loading branch information
bytesized committed Nov 29, 2024
1 parent e9b028d commit d843bc3
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 41 deletions.
192 changes: 158 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ repository = "https://github.com/bytesized/utilities"

[dependencies]
clap = { version = "4.0.29", features = ["derive"] }
crossterm = "0.25.0"
crossterm = "0.28.1"
num = "0.4.2"
rusqlite = { version = "0.28.0", features = ["bundled"] }
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ Control+D exits on all operating system including when using `-a`.

bcalc supports several navigation hotkeys:

- Larger movement distance with arrow keys by additionally using Control
- Control+M when the cursor is over a parenthesis to jump to the matching one.
- Larger movement distance with arrow keys by additionally using Control or Shift.
- Control+N when the cursor is over a parenthesis to jump to the matching one.

## TODO

This project is still a work in progress. A number of features are planned or do not yet work properly:

- Fix navigation hotkeys. They don't seem to be working right, at least on macOS.
- Allow argument configuration values to be saved.
- Enable more detailed errors that point at the location of the error in the input.
- Add a `/quit` command.
Expand Down
Loading

0 comments on commit d843bc3

Please sign in to comment.