Skip to content

Add keypress support#65

Merged
Mzack9999 merged 12 commits intomainfrom
feat-console-keypress
Mar 18, 2023
Merged

Add keypress support#65
Mzack9999 merged 12 commits intomainfrom
feat-console-keypress

Conversation

@Mzack9999
Copy link
Copy Markdown
Member

@Mzack9999 Mzack9999 commented Jan 30, 2023

@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Jan 30, 2023
@Mzack9999 Mzack9999 self-assigned this Jan 30, 2023
@Mzack9999 Mzack9999 marked this pull request as draft January 30, 2023 09:28
Copy link
Copy Markdown
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mzack9999 couple of things to confirms

will review this based on response since this requires some knowledge of low level terminal syscall stuff

@Mzack9999
Copy link
Copy Markdown
Member Author

Mzack9999 commented Mar 11, 2023

@tarunKoyalwar

  • The part related to rawmode is not anymore needed probably, as the stats are exposed via local API (more straightforward design + fixes indirectly stats availability/monitoring), anyway since it's a generic raw console implementation with a timeout, and I didn't see any around, I thought it could be a good addition. I think we can eventually keep it if, in the future, we will need a similar functionality.
  • The problem with ReadConsoleInput and with buffered inputs, in general, is that if there aren't enough data available, no input is read. Hence we need to set the raw mode to process an arbitrary stream of data continuously without new lines (the reason why I didn't remove the code, as it might come in handy in the future)

I'd suggest eventually to perform the review on code correctness level, as runtime usage for now seems very limited

@Mzack9999
Copy link
Copy Markdown
Member Author

Merging - The PR mainly adds two new strings helpers and implements a generic library to set the raw mode for console with a prototype of keypress_reader (which reads from stdin without buffering)

@Mzack9999 Mzack9999 merged commit fdee090 into main Mar 18, 2023
@Mzack9999 Mzack9999 deleted the feat-console-keypress branch March 18, 2023 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Enhancement Most issues will probably ask for additions or changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more string helpers

2 participants