Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add improved scrolling #45

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

CamKem
Copy link

@CamKem CamKem commented Dec 29, 2024

This pull request includes changes to enhance the scrolling functionality when using a full keyboard with page up & down, home & end keys.

The current scrolling via up, down, shift up & shift down are fine on laptop or limited size keyboard, however it would be nice to have the ability to scroll exactly one page / frame at a time. This can help when you need to look through any information dense data, allowing quick reading ensuring you haven't missed anything.

To facilitate this I have mapped this this functionality to the page up and page down keys.

In addition to this, I have also mapped home and end keys to scroll to the top and bottom respectively of the scroll panel.

@CamKem CamKem changed the title Feat/improve scrolling Feat: add improved scrolling Dec 29, 2024
@CamKem
Copy link
Author

CamKem commented Dec 29, 2024

Have added a PR on prompts to add the constants for key mapping of the page up / page down keys: laravel/prompts#179 which can be added if it get merged.

EDIT: The key binding have been merged on prompts, once it's released i'll commit the updates.

@IronSinew
Copy link
Contributor

Have added a PR on prompts to add the constants for key mapping of the page up / page down keys: laravel/prompts#179 which can be added if it get merged.

EDIT: The key binding have been merged on prompts, once it's released i'll commit the updates.

It seems like it has been released! 🎉

https://github.com/laravel/prompts/releases/tag/v0.3.3

@aarondfrancis
Copy link
Collaborator

I can look at this now! Sorry for the long delay. I basically rewrote the whole package in a PR, like a big dummy

@CamKem
Copy link
Author

CamKem commented Feb 1, 2025

I can look at this now! Sorry for the long delay. I basically rewrote the whole package in a PR, like a big dummy

@aarondfrancis - Love the rewrite! I'm sure many of us do huge PR's in a single branch hidden in our private Repo's, no judgment here...

I see you have already added the same logic I was suggesting for page up / down, but rather using the shift up + arrow binding, this will just add an extra ability.

I have rebased & and made the changes based on the new api & it's good to go.

As perApple devices (https://support.apple.com/en-au/102650) key binding for improved scrolling using the following:

Scroll Action Extended Magic Keyboard MacBook / Magic Keyboard
Up 1 Frame PageUp Fn UpArrow
Down 1 Frame PageDown Fn DownArrow
To Top Home Fn LeftArrow
To Bottom End Fn RightArrow

No breaking changes to the existing key bindings, just these added improvements for scrolling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants