User defined keyboard shortcuts #219

Open
opened 2022-04-08 09:18:38 +00:00 by famubu · 2 comments

Is there a way to change the default keyboard shortcuts in bombadillo?

Like using a key other than u to scroll a page up.

Is there a way to change the default keyboard shortcuts in bombadillo? Like using a key other than `u` to scroll a page up.
Owner

Not on the fly. It is really easy to modify that particular section of the code and recompile though. Go here to see the function in question. It is just a big switch statement, so you'll see something like (in the case of your example):

case "u":
    // some code...

Which you could change to, lets say... "n" for some reason:

case "n":
    // some code...

You just want to make sure it doesnt take up a key that is being used for something else. If it is, you will want to change that other key as well.

Then you would just recompile by running make from within the repo directory. If you need any help doing this let me know and I'd be happy to help. I could, for a future version, likely create a var list in its own file for this purpose and then reference those variables. For now though, editing client.go around the line linked above is the best way to go about it. Feel free to e-mail me on rawtext club if you need or want help. I can likely even produce a binary for you if you want to just email the keys you want changed (if you dont feel comfortable doing it yourself).

Not on the fly. It is _really_ easy to modify that particular section of the code and recompile though. Go [here](https://tildegit.org/sloum/bombadillo/src/branch/master/client.go#L144) to see the function in question. It is just a big switch statement, so you'll see something like (in the case of your example): ``` go case "u": // some code... ``` Which you could change to, lets say... "n" for some reason: ``` go case "n": // some code... ``` You just want to make sure it doesnt take up a key that is being used for something else. If it is, you will want to change that other key as well. Then you would just recompile by running `make` from within the repo directory. If you need any help doing this let me know and I'd be happy to help. I could, for a future version, likely create a var list in its own file for this purpose and then reference those variables. For now though, editing `client.go` around the line linked above is the best way to go about it. Feel free to e-mail me on rawtext club if you need or want help. I can likely even produce a binary for you if you want to just email the keys you want changed (if you dont feel comfortable doing it yourself).
Author

Thanks!

I edited client.go and made it to this.
Compilation was easy enough thanks to the Makefile.

I was wondering why page scrolling was kept at 75% and not 100%.

Now I see why.

It scrolls too much.
But couldn't figure out why. 100% seems to mean more than 100% sometimes?

Thanks! I edited client.go and made it to [this](https://tildegit.org/famubu/bombadillo/src/branch/modkeys/client.go#L201). Compilation was easy enough thanks to the Makefile. I was wondering why page scrolling was kept at 75% and not 100%. Now I see why. It scrolls too much. But couldn't figure out why. 100% seems to mean more than 100% sometimes?
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sloum/bombadillo#219
No description provided.