-
Notifications
You must be signed in to change notification settings - Fork 297
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
MISC: Add key binding feature #1830
base: dev
Are you sure you want to change the base?
MISC: Add key binding feature #1830
Conversation
# Conflicts: # src/ScriptEditor/ui/ScriptEditorRoot.tsx # src/Settings/Settings.ts
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'm finally getting around to this.
High-level comments:
First off, great job! The screenshots of the UI look great.
Actually, that's it for high-level comments, the rest is specifics XD
} | ||
} | ||
// Terminal-ClearScreen | ||
if (isKeyCombinationPressed(newCombination, { control: true, code: KEYCODE.L })) { |
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.
We should probably make this one bindable, but that can be for another day.
// Bash hotkeys | ||
if ( | ||
Settings.EnableBashHotkeys && | ||
(isKeyCombinationPressed(newCombination, { control: true, code: KEYCODE.M }) || |
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.
The bash hotkeys definitely should be bindable, but that can also be for another day.
It's ready for the next review now. I moved |
This looks good to me. One last thing is, can you use the deploy action in GitHub to host this at https://catloversg.github.io/bitburner-src (or maybe it's already hosted somewhere else) so we can play with it? I'd like to, but more importantly Zoë expressed a strong desire to have a heads-up on keybinding-related changes, and they're the only person I am certain of who has a Mac to test this on. |
It's available at https://catloversg.github.io/bitburner-src/. |
There's one last thing I think we should add before we merge; the rest can be added iteratively later. That is Denis' suggestion of only saving explicitly set keybinds, so that future changes to the defaults won't end up locked in. This is a chunk of additional complexity (you'll probably need to keep a merged and unmerged version for different purposes), but it's something that lots of other games do and one that I think we will regret it we don't have. And it has to be done now, to be effective. Note that this pretty much requires that hitting "default" on the secondary bind restores the secondary default, since hitting "default" will be how you clear a "set" keybind. (Add opposed to "clear", which sets it to clear.) |
This feature has been requested for a long time. It's the only way to properly fix wrong behaviors of shortcuts.
Tested: I played for a while with US, US Intl, and US Dvorak.
Screenshots:
![Capture1](https://private-user-images.githubusercontent.com/152669316/393616394-e507b3d9-6a44-4d24-9384-0e871073c58a.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5ODQ3MjcsIm5iZiI6MTczOTk4NDQyNywicGF0aCI6Ii8xNTI2NjkzMTYvMzkzNjE2Mzk0LWU1MDdiM2Q5LTZhNDQtNGQyNC05Mzg0LTBlODcxMDczYzU4YS5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxOVQxNzAwMjdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iY2EzOGQxZDNkODQ4M2M0MjMxMzYwNDc3NDhiYWViNGRiNDUzMDA5MjM4ZjAwOGVjYTBhMjBhNjI3YzdjNmM0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.aDOwxkBvi2EBqDTwODXQM_BGQv36rkhYgpNo4n6t3eI)
![Capture2](https://private-user-images.githubusercontent.com/152669316/393616398-b525fe2c-c498-4fc4-b8dc-c37c7c635cc5.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5ODQ3MjcsIm5iZiI6MTczOTk4NDQyNywic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