Feature Request - PgUp/PgDn Key Support #207

Open
opened 4 weeks ago by demure · 1 comments
demure commented 4 weeks ago

Can some default bindings be added for PgUp/PgDn keys?
I find these keys indispensible when using cli programs, and it would be nice if bombadillo used them as well.

Can some default bindings be added for PgUp/PgDn keys? I find these keys indispensible when using cli programs, and it would be nice if bombadillo used them as well.
Owner

Sadly, Golang does not provide any form of get key functionality and Bombadillo has a strict policy of not using third party libraries. As a result we have rolled our own get key functionality. Due in part to being a vi keybinding oriented client we did not add parsing for multibyte keys (ctrl+key, arrows, pgup/down, etc). I wont say never, but I do not see this changing any time soon.

You can access page up and down functionality with u and d in the interim. Those could easily be mapped to other single byte keys really easily in client.go's main input loop if you would like a different single byte binding.

I have resisted remappable keys for Bombadillo, but maybe it is time to consider that as something to offer (though it would still only offer single byte keys). My development time is slim (I have a 2 year old), but I will add remapping to my eventual to do list.

I would definitely be open to a pull request with multibyte input parsing for getKey (that does not involve a third party lib). If you were interested in taking a shot at it the relevant code would be in the cui folder and the termios folder. The termios would need to be set with a short timeout on keypress and the cui code for get key would need to read multiple and be able to accept null read. I know it can be done in go, but I'm not sure how to do it (I could do it in C, but don't want to drop to cgo).

Sorry for the longwinded answer, but I did want to fully consider the request and respond with my thoughts on it.

Sadly, Golang does not provide any form of get key functionality and Bombadillo has a strict policy of not using third party libraries. As a result we have rolled our own get key functionality. Due in part to being a vi keybinding oriented client we did not add parsing for multibyte keys (ctrl+key, arrows, pgup/down, etc). I wont say never, but I do not see this changing any time soon. You can access page up and down functionality with `u` and `d` in the interim. Those could easily be mapped to other single byte keys really easily in `client.go`'s main input loop if you would like a different single byte binding. I have resisted remappable keys for Bombadillo, but maybe it is time to consider that as something to offer (though it would still only offer single byte keys). My development time is slim (I have a 2 year old), but I will add remapping to my eventual to do list. I would definitely be open to a pull request with multibyte input parsing for getKey (that does not involve a third party lib). If you were interested in taking a shot at it the relevant code would be in the `cui` folder and the `termios` folder. The termios would need to be set with a short timeout on keypress and the cui code for get key would need to read multiple and be able to accept null read. I know it can be done in go, but I'm not sure how to do it (I could do it in C, but don't want to drop to cgo). Sorry for the longwinded answer, but I did want to fully consider the request and respond with my thoughts on it.
sloum added the
enhancement
label 4 weeks ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.