-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add support for more keys #90
base: master
Are you sure you want to change the base?
Conversation
lingrlongr
commented
Nov 15, 2022
- Added support for different keycodes for up/down
- Added support for quitting the menu
- Added support for different keycodes for up/down - Added support for quitting the menu
@@ -11,10 +11,15 @@ class Option: | |||
value: Any | |||
|
|||
|
|||
GITBASH_KEY_UP = 450 | |||
GITBASH_KEY_DOWN = 456 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is gitbash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an Windows application that provides an emulation layer for a Git command line experience in a familiar bash interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of hard-code these special codes here, it would be better to have a method for users to config them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to fork pick to have the ability to exit!
This would combine nicely with the ability to set custom keys (so pick doesn't have to have custom keys for gitbash, or VS code as I saw in another issue).
I could work on this if the author of this PR is not interested to work on it anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after thinking a bit about it (and this may be already clear for the maintainers), custom key bindings are already supported by the ability to set them at the module level. For instance to support the numpad to navigate, one might simply do
import pick
pick.KEYS_UP += (ord("8"),)
pick.KEYS_DOWN += (ord("2"),)
KEY_NUMPAD_ENTER = 459
pick.KEYS_ENTER += (KEY_NUMPAD_ENTER,)
Because of this, I will only tackle the exit option, to reduce the scope of my PR