-
Notifications
You must be signed in to change notification settings - Fork 245
Custom Key Mappings #437
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
base: main
Are you sure you want to change the base?
Custom Key Mappings #437
Conversation
✅ Deploy Preview for nimble-elf-d9d491 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
its-miroma
left a comment
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're never escaping the Misc category, aren't we...
reference/latest/src/client/java/com/example/docs/keymapping/ExampleModKeyMappingsClient.java
Show resolved
Hide resolved
|
|
||
| @[code lang=java transcludeWith=:::client_tick_event](@/reference/latest/src/client/java/com/example/docs/keymapping/ExampleModKeyMappingsClient.java) | ||
|
|
||
| This will print "Key Pressed!" to the in-game chat every time the mapped key is pressed. |
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.
| This will print "Key Pressed!" to the in-game chat every time the mapped key is pressed. | |
| This will print "Key Pressed!" to the in-game chat every time the mapped key is pressed. Keep in mind that holding the key will repeatedly print the message to the chat, so you might want to implement guards so this logic only triggers once. |
to avoid repeating "logic"
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'd argue that the repeating logic could the desired behavior. There could be a valid use case for repeated execution, like a gun or something.
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 could be, but it bears mentioning in case the intending use case is something that shouldn't be repeatedly triggered like a config change or opening a screen.
|
|
||
| @[code lang=java transcludeWith=:::client_tick_event](@/reference/latest/src/client/java/com/example/docs/keymapping/ExampleModKeyMappingsClient.java) | ||
|
|
||
| This will print "Key Pressed!" to the in-game chat every time the mapped key is pressed. |
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.
| This will print "Key Pressed!" to the in-game chat every time the mapped key is pressed. | |
| This will print "Key Pressed!" to the in-game chat every time the mapped key is pressed. Keep in mind that holding the key will repeatedly print the message to the chat, so you might want to implement guards so this logic only triggers once. |
to avoid repeating "logic"
its-miroma
left a comment
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.
Wait no, there's still an unsatisfied suggestion by @cassiancc
A simple page for custom key mappings.