Skip to content
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

Add input_character_immediate() function to Stdlib #21826

Open
1 of 2 tasks
mike-ward opened this issue Jul 8, 2024 · 0 comments
Open
1 of 2 tasks

Add input_character_immediate() function to Stdlib #21826

mike-ward opened this issue Jul 8, 2024 · 0 comments
Labels
Feature Request This issue is made to request a feature.

Comments

@mike-ward
Copy link
Contributor

mike-ward commented Jul 8, 2024

Describe the feature

Add new function to Stdib that will get a character from stdin if available or return -1 if not.

Use Case

I want to add keyboard commands to the recently submitted vmatrix example. Currently, there does not appear to be to console input function that does not wait for user input.

Proposed Solution

Add an input function similar to wgetch() from the ncursors lib.

fn input_character_no_wait() int or fn input_character_immediate() int are possible names for this function. If no character is waiting in the input buffer, the function returns -1.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

V 0.4.6 f6de36d

Environment details (OS name and version, etc.)

V full version: V 0.4.6 8215f21.f6de36d
OS: macos, macOS, 14.5, 23F79
Processor: 8 cpus, 64bit, little endian, Apple M2

getwd: /Users/mike/Documents/github/vmatrix
vexe: /Users/mike/Documents/github/v/v
vexe mtime: 2024-07-07 15:50:01

vroot: OK, value: /Users/mike/Documents/github/v
VMODULES: OK, value: /Users/mike/.vmodules
VTMP: OK, value: /tmp/v_501

Git version: git version 2.45.2
Git vroot status: weekly.2024.27-30-g740be17c (3 commit(s) behind V master)
.git/config present: true

CC version: Apple clang version 15.0.0 (clang-1500.3.9.4)
thirdparty/tcc status: thirdparty-macos-arm64 5c1d002f
Mikes-Air➜ vmatrix ᐅ

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@mike-ward mike-ward added the Feature Request This issue is made to request a feature. label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request This issue is made to request a feature.
Projects
None yet
Development

No branches or pull requests

1 participant